Total Complexity | 4 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | abstract class AbstractDataField implements DataFieldInterface |
||
8 | { |
||
9 | /** @var callable */ |
||
10 | private $transformFunction; |
||
11 | |||
12 | /** |
||
13 | * @param callable|null $transformFunction |
||
14 | */ |
||
15 | 411 | public function __construct(private readonly string $name, callable $transformFunction = null) |
|
16 | { |
||
17 | 411 | if (null === $transformFunction) { |
|
18 | 373 | $transformFunction = fn ($input): string => trim((string) $input); |
|
19 | } |
||
20 | 411 | $this->transformFunction = $transformFunction; |
|
21 | } |
||
22 | |||
23 | 399 | public function name(): string |
|
26 | } |
||
27 | |||
28 | 231 | public function transform($input) |
|
35 |