protected static function wrapWithJoinPoints(array $classAdvices, string $className): array
    {
        /** @var LazyAdvisorAccessor $accessor */
        static $accessor;

        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;
    }
protected static function wrapWithJoinPoints(array $classAdvices, string $className): array
    {
        /** @var LazyAdvisorAccessor $accessor */
        static $accessor;

        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;
    }
protected static function wrapWithJoinPoints ( array $ classAdvices , string $ className ) : array { /** @var LazyAdvisorAccessor $accessor */ static $ accessor ; 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 ; }
Wrap advices with joinpoint object

@param array|Advice[][][] $classAdvices Advices for specific class

@throws \UnexpectedValueException If joinPoint type is unknown

NB: Extension should be responsible for wrapping advice with join point.

@return Joinpoint[] returns list of joinpoint ready to use
Wrap advices with joinpoint object