public function invoke(MethodInvocation $invocation)
    {
        /** @var ReflectionMethod $method */
        $method = $invocation->getMethod();
        $assisted = $method->getAnnotation(Assisted::class);
        /* @var \Ray\Di\Di\Assisted $assisted */
        $parameters = $method->getParameters();
        $arguments = $invocation->getArguments()->getArrayCopy();
        if ($assisted instanceof Assisted && $method instanceof ReflectionMethod) {
            $this->methodInvocationProvider->set($invocation);
            $arguments = $this->injectAssistedParameters($method, $assisted, $parameters, $arguments);
        }
        $invocation->getArguments()->exchangeArray($arguments);

        return $invocation->proceed();
    }
public function invoke(MethodInvocation $invocation)
    {
        /** @var ReflectionMethod $method */
        $method = $invocation->getMethod();
        $assisted = $method->getAnnotation(Assisted::class);
        /* @var \Ray\Di\Di\Assisted $assisted */
        $parameters = $method->getParameters();
        $arguments = $invocation->getArguments()->getArrayCopy();
        if ($assisted instanceof Assisted && $method instanceof ReflectionMethod) {
            $this->methodInvocationProvider->set($invocation);
            $arguments = $this->injectAssistedParameters($method, $assisted, $parameters, $arguments);
        }
        $invocation->getArguments()->exchangeArray($arguments);

        return $invocation->proceed();
    }
public function invoke ( MethodInvocation $ invocation ) { /** @var ReflectionMethod $method */ $ method = $ invocation -> getMethod ( ) ; $ assisted = $ method -> getAnnotation ( Assisted :: class ) ; /* @var \Ray\Di\Di\Assisted $assisted */ $ parameters = $ method -> getParameters ( ) ; $ arguments = $ invocation -> getArguments ( ) -> getArrayCopy ( ) ; if ( $ assisted instanceof Assisted && $ method instanceof ReflectionMethod ) { $ this -> methodInvocationProvider -> set ( $ invocation ) ; $ arguments = $ this -> injectAssistedParameters ( $ method , $ assisted , $ parameters , $ arguments ) ; } $ invocation -> getArguments ( ) -> exchangeArray ( $ arguments ) ; return $ invocation -> proceed ( ) ; }
Intercepts any method and injects instances of the missing arguments
when they are type hinted

@return object
Intercepts any method and injects instances of the missing arguments when they are type hinted