1 | <?php |
||
14 | final class AssistedInterceptor implements MethodInterceptor |
||
15 | { |
||
16 | /** |
||
17 | * @var InjectorInterface |
||
18 | */ |
||
19 | private $injector; |
||
20 | |||
21 | 2 | public function __construct(InjectorInterface $injector) |
|
25 | |||
26 | /** |
||
27 | * Intercepts any method and injects instances of the missing arguments |
||
28 | * when they are type hinted |
||
29 | */ |
||
30 | 2 | public function invoke(MethodInvocation $invocation) |
|
45 | |||
46 | 2 | private function getName(ReflectionMethod $method, \ReflectionParameter $parameter) |
|
60 | |||
61 | /** |
||
62 | * @param \ReflectionMethod $method |
||
63 | * @param Assisted $assisted |
||
64 | * @param \ReflectionParameter[] $parameters |
||
65 | * @param array $arguments |
||
66 | * @param int $cntArgs |
||
67 | * |
||
68 | * @return array |
||
69 | */ |
||
70 | 2 | public function injectAssistedParameters(\ReflectionMethod $method, Assisted $assisted, array $parameters, array $arguments, $cntArgs) |
|
84 | } |
||
85 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.