Go\Proxy\ClassProxy::wrapWithJoinPoints PHP Method

wrapWithJoinPoints() protected static method

Wrap advices with joinpoint object
protected static wrapWithJoinPoints ( array | Go\Aop\Advice[] $classAdvices, string $className ) : array | Go\Aop\Intercept\Joinpoint[]
$classAdvices array | Go\Aop\Advice[] Advices for specific class
$className string Name of the original class to use
return array | Go\Aop\Intercept\Joinpoint[] returns list of joinpoint ready to use
    protected static function wrapWithJoinPoints($classAdvices, $className)
    {
        /** @var LazyAdvisorAccessor $accessor */
        static $accessor = null;
        if (!isset($accessor)) {
            $aspectKernel = AspectKernel::getInstance();
            $accessor = $aspectKernel->getContainer()->get('aspect.advisor.accessor');
        }
        $joinPoints = [];
        foreach ($classAdvices as $joinPointType => $typedAdvices) {
            // if not isset then we don't want to create such invocation for class
            if (!isset(self::$invocationClassMap[$joinPointType])) {
                continue;
            }
            foreach ($typedAdvices as $joinPointName => $advices) {
                $filledAdvices = [];
                foreach ($advices as $advisorName) {
                    $filledAdvices[] = $accessor->{$advisorName};
                }
                $joinpoint = new self::$invocationClassMap[$joinPointType]($className, $joinPointName, $filledAdvices);
                $joinPoints["{$joinPointType}:{$joinPointName}"] = $joinpoint;
            }
        }
        return $joinPoints;
    }