1 | <?php |
||
12 | final class Annotation |
||
13 | { |
||
14 | /** |
||
15 | * @var VariableAnnotation[] |
||
16 | */ |
||
17 | private $properties = []; |
||
18 | /** |
||
19 | * @var VariableAnnotation[][] |
||
20 | */ |
||
21 | private $parameters = []; |
||
22 | |||
23 | /** |
||
24 | * Annotation constructor. |
||
25 | * |
||
26 | * @param ReflectionClass $class |
||
27 | * |
||
28 | * @throws Exception |
||
29 | */ |
||
30 | public function __construct(ReflectionClass $class) |
||
37 | |||
38 | /** |
||
39 | * @param AnnotationParser $parser |
||
40 | * @param ReflectionClass $class |
||
41 | * |
||
42 | * @throws Exception |
||
43 | */ |
||
44 | private function collectPropertyAnnotations(AnnotationParser $parser, ReflectionClass $class): void |
||
62 | |||
63 | /** |
||
64 | * @param AnnotationParser $parser |
||
65 | * @param ReflectionClass $class |
||
66 | * |
||
67 | * @throws Exception |
||
68 | */ |
||
69 | private function collectMethodParameterAnnotations(AnnotationParser $parser, ReflectionClass $class): void |
||
82 | |||
83 | /** |
||
84 | * @return VariableAnnotation[] |
||
85 | */ |
||
86 | public function getAllProperties(): array |
||
90 | |||
91 | /** |
||
92 | * @param string $property |
||
93 | * |
||
94 | * @return VariableAnnotation |
||
95 | */ |
||
96 | public function getProperty(string $property): VariableAnnotation |
||
100 | |||
101 | /** |
||
102 | * @param string $property |
||
103 | * |
||
104 | * @return bool |
||
105 | */ |
||
106 | public function hasProperty(string $property): bool |
||
110 | |||
111 | /** |
||
112 | * @return VariableAnnotation[][] |
||
113 | */ |
||
114 | public function getAllMethodsParameters(): array |
||
118 | |||
119 | /** |
||
120 | * @param string $method |
||
121 | * |
||
122 | * @return VariableAnnotation[] |
||
123 | */ |
||
124 | public function getMethodParameters(string $method): array |
||
128 | |||
129 | /** |
||
130 | * @param string $method |
||
131 | * @param string $param |
||
132 | * |
||
133 | * @return VariableAnnotation |
||
134 | */ |
||
135 | public function getMethodParameter(string $method, string $param): VariableAnnotation |
||
139 | |||
140 | /** |
||
141 | * @param string $method |
||
142 | * @param string|null $param |
||
143 | * |
||
144 | * @return bool |
||
145 | */ |
||
146 | public function hasMethodParameter(string $method, string $param = null): bool |
||
150 | } |
||
151 |