Go\Core\AdviceMatcher::getFunctionAdvicesFromAdvisor PHP Méthode

getFunctionAdvicesFromAdvisor() private méthode

Returns list of function advices for specific namespace
private getFunctionAdvicesFromAdvisor ( Go\ParserReflection\ReflectionFileNamespace $namespace, Go\Aop\PointcutAdvisor $advisor, string $advisorId, Go\Aop\PointFilter $pointcut ) : array
$namespace Go\ParserReflection\ReflectionFileNamespace
$advisor Go\Aop\PointcutAdvisor Advisor for class
$advisorId string Identifier of advisor
$pointcut Go\Aop\PointFilter Filter for points
Résultat array
    private function getFunctionAdvicesFromAdvisor(ReflectionFileNamespace $namespace, Aop\PointcutAdvisor $advisor, $advisorId, Aop\PointFilter $pointcut)
    {
        $functions = [];
        $advices = [];
        $listOfGlobalFunctions = get_defined_functions();
        foreach ($listOfGlobalFunctions['internal'] as $functionName) {
            $functions[$functionName] = new NamespacedReflectionFunction($functionName, $namespace->getName());
        }
        foreach ($functions as $functionName => $function) {
            if ($pointcut->matches($function, $namespace)) {
                $advices[AspectContainer::FUNCTION_PREFIX][$functionName][$advisorId] = $advisor->getAdvice();
            }
        }
        return $advices;
    }