1 | <?php |
||
23 | class IntroductionAspectExtension extends AbstractAspectLoaderExtension |
||
24 | { |
||
25 | |||
26 | /** |
||
27 | * Introduction aspect loader works with annotations from aspect |
||
28 | * |
||
29 | * For extension that works with annotations additional metaInformation will be passed |
||
30 | * |
||
31 | * @return string |
||
32 | */ |
||
33 | public function getKind() |
||
34 | { |
||
35 | return self::KIND_ANNOTATION; |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * Introduction aspect loader works only with properties of aspect |
||
40 | * |
||
41 | * @return string|array |
||
42 | */ |
||
43 | 2 | public function getTarget() |
|
47 | |||
48 | /** |
||
49 | * Checks if loader is able to handle specific point of aspect |
||
50 | * |
||
51 | * @param Aspect $aspect Instance of aspect |
||
52 | * @param mixed|\ReflectionClass|\ReflectionMethod|\ReflectionProperty $reflection Reflection of point |
||
53 | * @param mixed|null $metaInformation Additional meta-information, e.g. annotation for method |
||
54 | * |
||
55 | * @return boolean true if extension is able to create an advisor from reflection and metaInformation |
||
56 | */ |
||
57 | public function supports(Aspect $aspect, $reflection, $metaInformation = null) |
||
63 | |||
64 | /** |
||
65 | * Loads definition from specific point of aspect into the container |
||
66 | * |
||
67 | * @param Aspect $aspect Instance of aspect |
||
68 | * @param mixed|\ReflectionClass|\ReflectionMethod|\ReflectionProperty $reflection Reflection of point |
||
69 | * @param mixed|null $metaInformation Additional meta-information |
||
70 | * |
||
71 | * @throws \UnexpectedValueException |
||
72 | * |
||
73 | * @return array|Pointcut[]|Advisor[] |
||
74 | */ |
||
75 | public function load(Aspect $aspect, $reflection, $metaInformation = null) |
||
105 | } |
||
106 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.