1 | <?php |
||
26 | class PropertiesInspector extends Base |
||
27 | { |
||
28 | /** |
||
29 | * @readwrite |
||
30 | * @var ObjectDefinitionInterface |
||
31 | */ |
||
32 | protected $definition; |
||
33 | |||
34 | /** @var string[] */ |
||
35 | private $properties; |
||
36 | |||
37 | /** @var Inspector */ |
||
38 | private $classInspector; |
||
39 | |||
40 | /** |
||
41 | * Set the definition that will be updated |
||
42 | * |
||
43 | * @param ObjectDefinitionInterface $definition |
||
44 | * @return $this|self|PropertiesInspector |
||
45 | */ |
||
46 | 46 | public function setDefinition(ObjectDefinitionInterface $definition) |
|
53 | |||
54 | /** |
||
55 | * Updated property list on definition based on class inspection |
||
56 | */ |
||
57 | 46 | private function updateDefinition() |
|
65 | |||
66 | /** |
||
67 | * Gets class property list |
||
68 | * |
||
69 | * @return string[] |
||
70 | */ |
||
71 | 46 | private function getProperties() |
|
79 | |||
80 | /** |
||
81 | * Gets class inspector |
||
82 | * |
||
83 | * @return Inspector |
||
84 | */ |
||
85 | 46 | private function getClassInspector() |
|
94 | |||
95 | /** |
||
96 | * Check if the property has defined the @inject annotation |
||
97 | * |
||
98 | * @param string $property |
||
99 | * |
||
100 | * @return bool |
||
101 | */ |
||
102 | 36 | private function hasInjectAnnotation($property) |
|
108 | |||
109 | /** |
||
110 | * Get inject annotation for provided property |
||
111 | * |
||
112 | * @param string $property |
||
113 | * @return Basic|\Slick\Common\AnnotationInterface |
||
114 | */ |
||
115 | 14 | private function getInjectAnnotation($property) |
|
121 | |||
122 | /** |
||
123 | * Get var annotation for provided property |
||
124 | * |
||
125 | * @param string $property |
||
126 | * |
||
127 | * @return null|string |
||
128 | */ |
||
129 | 14 | private function getVarAnnotationValue($property) |
|
142 | |||
143 | /** |
||
144 | * Adds property to the definition property list |
||
145 | * |
||
146 | * @param string $property |
||
147 | */ |
||
148 | 14 | private function addProperty($property) |
|
167 | } |
||
168 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..