Neos\Flow\Aop\Builder\ProxyClassBuilder::addAdvicedMethodsToInterceptedMethods PHP Метод

addAdvicedMethodsToInterceptedMethods() защищенный Метод

Traverses all aspect containers, their aspects and their advisors and adds the methods and their advices to the (usually empty) array of intercepted methods.
protected addAdvicedMethodsToInterceptedMethods ( array &$interceptedMethods, array $methods, string $targetClassName, array &$aspectContainers ) : void
$interceptedMethods array
$methods array An array of class and method names which are matched against the pointcut (class name = name of the class or interface the method was declared)
$targetClassName string Name of the class the pointcut should match with
$aspectContainers array
Результат void
    protected function addAdvicedMethodsToInterceptedMethods(array &$interceptedMethods, array $methods, $targetClassName, array &$aspectContainers)
    {
        $pointcutQueryIdentifier = 0;
        foreach ($aspectContainers as $aspectContainer) {
            if (!$aspectContainer->getCachedTargetClassNameCandidates()->hasClassName($targetClassName)) {
                continue;
            }
            foreach ($aspectContainer->getAdvisors() as $advisor) {
                $pointcut = $advisor->getPointcut();
                foreach ($methods as $method) {
                    list($methodDeclaringClassName, $methodName) = $method;
                    if ($this->reflectionService->isMethodFinal($targetClassName, $methodName)) {
                        continue;
                    }
                    if ($this->reflectionService->isMethodStatic($targetClassName, $methodName)) {
                        continue;
                    }
                    if ($pointcut->matches($targetClassName, $methodName, $methodDeclaringClassName, $pointcutQueryIdentifier)) {
                        $advice = $advisor->getAdvice();
                        $interceptedMethods[$methodName]['groupedAdvices'][get_class($advice)][] = ['advice' => $advice, 'runtimeEvaluationsClosureCode' => $pointcut->getRuntimeEvaluationsClosureCode()];
                        $interceptedMethods[$methodName]['declaringClassName'] = $methodDeclaringClassName;
                    }
                    $pointcutQueryIdentifier++;
                }
            }
        }
    }