1 | <?php |
||
9 | final class ReflectionMethod extends \ReflectionMethod implements Reader |
||
10 | { |
||
11 | /** |
||
12 | * @var WeavedInterface |
||
13 | */ |
||
14 | private $object; |
||
15 | |||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | private $method; |
||
20 | |||
21 | /** |
||
22 | * Set dependencies |
||
23 | * |
||
24 | * @param WeavedInterface $object |
||
25 | * @param \ReflectionMethod $method |
||
26 | */ |
||
27 | 3 | public function setObject(WeavedInterface $object, \ReflectionMethod $method) |
|
32 | |||
33 | /** |
||
34 | * @return ReflectionClass |
||
35 | */ |
||
36 | 2 | public function getDeclaringClass() |
|
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | 2 | public function getAnnotations() |
|
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | 2 | public function getAnnotation($annotationName) |
|
70 | } |
||
71 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: