• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

heimrichhannot / contao-utils-bundle / 21215856260

21 Jan 2026 03:42PM UTC coverage: 78.687% (-0.07%) from 78.761%
21215856260

Pull #106

github

koertho
add test for custom title field
Pull Request #106: Allow customize alias title field

12 of 15 new or added lines in 2 files covered. (80.0%)

2 existing lines in 1 file now uncovered.

1163 of 1478 relevant lines covered (78.69%)

3.43 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.0
/src/Dca/AliasFieldConfiguration.php
1
<?php
2

3
namespace HeimrichHannot\UtilsBundle\Dca;
4

5
use HeimrichHannot\UtilsBundle\EventListener\DcaField\AliasDcaFieldListener;
6

7
class AliasFieldConfiguration extends DcaFieldConfiguration
8
{
9
    /**
10
     * @internal
11
     * @deprecated
12
     */
13
    public ?array $aliasExistCallback = [AliasDcaFieldListener::class, 'onFieldsAliasSaveCallback'];
14

15
    /**
16
     * @internal
17
     */
18
    public string $fieldName = 'alias';
19

20
    /**
21
     * @internal
22
     */
23
    public string $titleField = 'title';
24

25
    /**
26
     * @internal
27
     */
28
    public ?array $generateAliasCallback = [AliasDcaFieldListener::class, 'onFieldsAliasSaveCallback'];
29

30
    /**
31
     * @param array<string, string> $aliasExistCallback
32
     * @deprecated Deprecated since version 3.10. Use setGenerateAliasCallback instead.
33
     */
34
    public function setAliasExistCallback(?array $aliasExistCallback): AliasFieldConfiguration
35
    {
NEW
UNCOV
36
        $this->generateAliasCallback = $aliasExistCallback;
×
NEW
37
        return $this;
×
38
    }
39

40
    /**
41
     * Override the default alias generation function. Provide as [Class, 'method'].
42
     *
43
     * @param array<string, string> $callback
44
     */
45
    public function setGenerateAliasCallback(?array $callback): AliasFieldConfiguration
46
    {
47
        $this->generateAliasCallback = $callback;
1✔
48
        return $this;
1✔
49
    }
50

51
    public function setFieldName(string $fieldName): AliasFieldConfiguration
52
    {
UNCOV
53
        $this->fieldName = $fieldName;
×
54
        return $this;
×
55
    }
56

57
    /**
58
     * Set the field name from which the alias should be generated.
59
     */
60
    public function setTitleField(string $titleField): AliasFieldConfiguration
61
    {
62
        $this->titleField = $titleField;
1✔
63
        return $this;
1✔
64
    }
65
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc