1 | <?php |
||
24 | class DefaultPointcutAdvisor extends AbstractGenericPointcutAdvisor |
||
25 | { |
||
26 | |||
27 | /** |
||
28 | * Pointcut instance |
||
29 | * |
||
30 | * @var Pointcut |
||
31 | */ |
||
32 | private $pointcut; |
||
33 | |||
34 | /** |
||
35 | * Create a DefaultPointcutAdvisor, specifying Pointcut and Advice. |
||
36 | * |
||
37 | * @param Pointcut $pointcut The Pointcut targeting the Advice |
||
38 | * @param Advice $advice The Advice to run when Pointcut matches |
||
39 | */ |
||
40 | 2 | public function __construct(Pointcut $pointcut, Advice $advice) |
|
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | 2 | public function getAdvice() |
|
50 | { |
||
51 | 2 | $advice = parent::getAdvice(); |
|
52 | 2 | if ($this->pointcut->getKind() & PointFilter::KIND_DYNAMIC) { |
|
53 | $advice = new DynamicInvocationMatcherInterceptor( |
||
54 | $this->pointcut, |
||
55 | $advice |
||
|
|||
56 | ); |
||
57 | } |
||
58 | |||
59 | 2 | return $advice; |
|
60 | } |
||
61 | |||
62 | |||
63 | /** |
||
64 | * Get the Pointcut that drives this advisor. |
||
65 | * |
||
66 | * @return Pointcut The pointcut |
||
67 | */ |
||
68 | 2 | public function getPointcut() |
|
72 | |||
73 | /** |
||
74 | * Specify the pointcut targeting the advice. |
||
75 | * |
||
76 | * @param Pointcut $pointcut The Pointcut targeting the Advice |
||
77 | */ |
||
78 | public function setPointcut(Pointcut $pointcut) |
||
82 | |||
83 | /** |
||
84 | * Return string representation of object |
||
85 | * |
||
86 | * @return string |
||
87 | */ |
||
88 | public function __toString() |
||
95 | } |
||
96 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: