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

heimrichhannot / contao-utils-bundle / 15155552365

21 May 2025 06:55AM UTC coverage: 25.946% (+0.5%) from 25.433%
15155552365

push

github

web-flow
Add alias field (#101)

* add alias field

* add tests

* fix php 8 only code

* remove label

45 of 54 new or added lines in 4 files covered. (83.33%)

1542 of 5943 relevant lines covered (25.95%)

1.56 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
    public ?array $aliasExistCallback = [AliasDcaFieldListener::class, 'onFieldsAliasSaveCallback'];
10

11
    public string $fieldName = 'alias';
12

13
    /**
14
     * Override the default alias exist function. Provide as [Class, 'method'].
15
     *
16
     * @param array<string, string> $aliasExistCallback
17
     */
18
    public function setAliasExistCallback(?array $aliasExistCallback): AliasFieldConfiguration
19
    {
20
        $this->aliasExistCallback = $aliasExistCallback;
1✔
21
        return $this;
1✔
22
    }
23

24
    public function setFieldName(string $fieldName): AliasFieldConfiguration
25
    {
NEW
26
        $this->fieldName = $fieldName;
×
NEW
27
        return $this;
×
28
    }
29
}
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

© 2025 Coveralls, Inc