Total Complexity | 4 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Coverage | 27.59% |
Changes | 0 |
1 | <?php |
||
15 | #[\Attribute(\Attribute::TARGET_METHOD)] |
||
16 | class ExpressionPropertyMetadata extends PropertyMetadata |
||
17 | { |
||
18 | /** |
||
19 | * @var string|Expression |
||
20 | */ |
||
21 | public $expression; |
||
22 | |||
23 | 12 | /** |
|
24 | * @param string|Expression $expression |
||
25 | 12 | */ |
|
26 | 12 | public function __construct(string $class, string $fieldName, $expression) |
|
27 | 12 | { |
|
28 | 12 | $this->class = $class; |
|
29 | 12 | $this->name = $fieldName; |
|
30 | $this->expression = $expression; |
||
31 | 11 | $this->readOnly = true; |
|
32 | } |
||
33 | 11 | ||
34 | public function setAccessor(string $type, ?string $getter = null, ?string $setter = null): void |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | */ |
||
41 | protected function serializeToArray(): array |
||
46 | ]; |
||
47 | } |
||
48 | |||
49 | protected function unserializeFromArray(array $data): void |
||
59 |