1 | <?php |
||
26 | class IntroductionAspectExtension extends AbstractAspectLoaderExtension |
||
27 | { |
||
28 | |||
29 | /** |
||
30 | * Introduction aspect loader works with annotations from aspect |
||
31 | * |
||
32 | * For extension that works with annotations additional metaInformation will be passed |
||
33 | * |
||
34 | * @return string |
||
35 | */ |
||
36 | 1 | public function getKind(): string |
|
40 | |||
41 | /** |
||
42 | * Introduction aspect loader works only with properties of aspect |
||
43 | */ |
||
44 | 2 | public function getTargets(): array |
|
48 | |||
49 | /** |
||
50 | * Checks if loader is able to handle specific point of aspect |
||
51 | * |
||
52 | * @param Aspect $aspect Instance of aspect |
||
53 | * @param mixed|\ReflectionClass|\ReflectionMethod|\ReflectionProperty $reflection Reflection of point |
||
54 | * @param mixed|null $metaInformation Additional meta-information, e.g. annotation for method |
||
55 | * |
||
56 | * @return boolean true if extension is able to create an advisor from reflection and metaInformation |
||
57 | */ |
||
58 | public function supports(Aspect $aspect, $reflection, $metaInformation = null): bool |
||
64 | |||
65 | /** |
||
66 | * Loads definition from specific point of aspect into the container |
||
67 | * |
||
68 | * @param Aspect $aspect Instance of aspect |
||
69 | * @param Reflector|ReflectionProperty $reflection Reflection of point |
||
70 | * @param mixed|null $metaInformation Additional meta-information |
||
71 | * |
||
72 | * @throws \UnexpectedValueException |
||
73 | * |
||
74 | * @return Pointcut[]|Advisor[] |
||
75 | */ |
||
76 | public function load(Aspect $aspect, Reflector $reflection, $metaInformation = null): array |
||
105 | } |
||
106 |
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: