Total Complexity | 3 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
35 | #[Attribute(Attribute::TARGET_PROPERTY)] |
||
36 | final class Raw implements ChildBuilderAttributeInterface |
||
37 | { |
||
38 | 3 | public function __construct( |
|
39 | /** |
||
40 | * Enable or disable raw mode for parsing numbers |
||
41 | * |
||
42 | * @readonly |
||
43 | */ |
||
44 | private bool $flag = true, |
||
45 | ) { |
||
46 | 3 | } |
|
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | 1 | public function applyOnChildBuilder(AttributeForm $form, ChildBuilderInterface $builder): void |
|
52 | { |
||
53 | 1 | $builder->raw($this->flag); |
|
54 | } |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | 2 | public function generateCodeForChildBuilder(string $name, AttributesProcessorGenerator $generator, AttributeForm $form): void |
|
62 | } |
||
63 | } |
||
64 |