1 | <?php |
||
8 | class AnnotationsCollection |
||
9 | { |
||
10 | |||
11 | /** |
||
12 | * The parsed annotations definitions. |
||
13 | * |
||
14 | * @var \Wingu\OctopusCore\Reflection\Annotation\AnnotationDefinition[] |
||
15 | */ |
||
16 | protected $annotationsDefinitions = array(); |
||
17 | |||
18 | /** |
||
19 | * The annotation tags mapper. |
||
20 | * |
||
21 | * @var \Wingu\OctopusCore\Reflection\Annotation\TagMapper |
||
22 | */ |
||
23 | protected $tagsMapper; |
||
24 | |||
25 | /** |
||
26 | * Constructor. |
||
27 | * |
||
28 | * @param string $comment The comment string from which to extract the annotations. |
||
29 | */ |
||
30 | 129 | public function __construct($comment) |
|
35 | |||
36 | /** |
||
37 | * Set the annotation tag mapper. |
||
38 | * |
||
39 | * @param \Wingu\OctopusCore\Reflection\Annotation\TagMapper $tm The tag mapper to set. |
||
40 | * @return \Wingu\OctopusCore\Reflection\Annotation\AnnotationsCollection |
||
41 | */ |
||
42 | 15 | public function setTagMapper(TagMapper $tm) |
|
48 | |||
49 | /** |
||
50 | * Get the annotation mapper. |
||
51 | * |
||
52 | * @return \Wingu\OctopusCore\Reflection\Annotation\TagMapper |
||
53 | */ |
||
54 | 3 | public function getTagMapper() |
|
58 | |||
59 | /** |
||
60 | * Check if the collection contains an annotation tag. |
||
61 | * |
||
62 | * @param string $tag The annotation tag name to check. |
||
63 | * @return boolean |
||
64 | */ |
||
65 | 36 | public function hasAnnotationTag($tag) |
|
69 | |||
70 | /** |
||
71 | * Get all annotations. |
||
72 | * |
||
73 | * @return \Wingu\OctopusCore\Reflection\Annotation\Tags\TagInterface[] |
||
74 | */ |
||
75 | 42 | public function getAnnotations() |
|
84 | |||
85 | /** |
||
86 | * Get an annotation. |
||
87 | * |
||
88 | * @param string $tag The annotation tag name. |
||
89 | * @return \Wingu\OctopusCore\Reflection\Annotation\Tags\TagInterface[] |
||
90 | * @throws \Wingu\OctopusCore\Reflection\Annotation\Exceptions\OutOfBoundsException If there are no annotations with the specified tag. |
||
91 | */ |
||
92 | 21 | public function getAnnotation($tag) |
|
105 | |||
106 | /** |
||
107 | * Get the annotation class to use for an annotation tag. |
||
108 | * |
||
109 | * @param string $tag The annotation tag name. |
||
110 | * @return string |
||
111 | */ |
||
112 | 54 | protected function getAnnotationClass($tag) |
|
122 | |||
123 | /** |
||
124 | * Build all the annotation instances for an annotation tag. |
||
125 | * |
||
126 | * @param \Wingu\OctopusCore\Reflection\Annotation\AnnotationDefinition[] $annotationDefinitions The annotation tag name. |
||
127 | * @return \Wingu\OctopusCore\Reflection\Annotation\Tags\TagInterface[] |
||
128 | */ |
||
129 | 12 | protected function buildAnnotationsInstances(array $annotationDefinitions) |
|
138 | |||
139 | /** |
||
140 | * Build an annotation. |
||
141 | * |
||
142 | * @param \Wingu\OctopusCore\Reflection\Annotation\AnnotationDefinition $annotationDefinition The annotation definition. |
||
143 | * @return \Wingu\OctopusCore\Reflection\Annotation\Tags\TagInterface |
||
144 | */ |
||
145 | 30 | protected function buildAnnotationInstance(AnnotationDefinition $annotationDefinition) |
|
152 | } |
||
153 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: