Total Complexity | 7 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | class ExcludeAnnotation extends AbstractAnnotation |
||
27 | { |
||
28 | /** |
||
29 | * The name of the upload field |
||
30 | * |
||
31 | * @var bool |
||
32 | */ |
||
33 | protected $bValue; |
||
34 | |||
35 | /** |
||
36 | * @inheritDoc |
||
37 | * @throws AnnotationException |
||
38 | */ |
||
39 | public function initAnnotation(array $properties) |
||
40 | { |
||
41 | if(count($properties) !== 0 && |
||
42 | (count($properties) !== 1 || !isset($properties[0]) || !is_bool($properties[0]))) |
||
43 | { |
||
44 | throw new AnnotationException('the @exclude annotation requires a boolean or no property'); |
||
45 | } |
||
46 | $this->bValue = $properties[0] ?? true; |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @inheritDoc |
||
51 | */ |
||
52 | public function getName(): string |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * @inheritDoc |
||
59 | */ |
||
60 | public function getValue() |
||
65 |