1 | <?php |
||
31 | class GeneralAspectLoaderExtension extends AbstractAspectLoaderExtension |
||
32 | { |
||
33 | |||
34 | /** |
||
35 | * General aspect loader works with annotations from aspect |
||
36 | */ |
||
37 | 1 | public function getKind(): string |
|
41 | |||
42 | /** |
||
43 | * General aspect loader works only with methods of aspect |
||
44 | */ |
||
45 | 2 | public function getTargets(): array |
|
49 | |||
50 | /** |
||
51 | * Checks if loader is able to handle specific point of aspect |
||
52 | * |
||
53 | * @param Aspect $aspect Instance of aspect |
||
54 | * @param mixed|\ReflectionClass|\ReflectionMethod|\ReflectionProperty $reflection Reflection of point |
||
55 | * @param mixed|null $metaInformation Additional meta-information, e.g. annotation for method |
||
56 | * |
||
57 | * @return boolean true if extension is able to create an advisor from reflection and metaInformation |
||
58 | */ |
||
59 | 1 | 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|ReflectionMethod $reflection Reflection of point |
||
70 | * @param mixed|null $metaInformation Additional meta-information, e.g. annotation for method |
||
71 | * |
||
72 | * @return array|Pointcut[]|Advisor[] |
||
73 | * |
||
74 | * @throws \UnexpectedValueException |
||
75 | */ |
||
76 | 1 | public function load(Aspect $aspect, Reflector $reflection, $metaInformation = null): array |
|
101 | |||
102 | /** |
||
103 | * Returns an interceptor instance by meta-type annotation and closure |
||
104 | * |
||
105 | * @throws \UnexpectedValueException For unsupported annotations |
||
106 | */ |
||
107 | 1 | protected function getInterceptor(BaseInterceptor $metaInformation, Closure $adviceCallback): Interceptor |
|
128 | } |
||
129 |
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: