public function getAdvicesForClass(ReflectionClass $class, array $advisors): array
    {
        $classAdvices = [];
        $parentClass  = $class->getParentClass();

        $originalClass = $class;
        if ($parentClass && strpos($parentClass->name, AspectContainer::AOP_PROXIED_SUFFIX) !== false) {
            $originalClass = $parentClass;
        }

        foreach ($advisors as $advisorId => $advisor) {
            if ($advisor instanceof Aop\PointcutAdvisor) {
                $pointcut = $advisor->getPointcut();
                if ($pointcut->getClassFilter()->matches($class)) {
                    $classAdvices[] = $this->getAdvicesFromAdvisor($originalClass, $advisor, $advisorId, $pointcut);
                }
            }

            if ($advisor instanceof Aop\IntroductionAdvisor) {
                if ($advisor->getClassFilter()->matches($class)) {
                    $classAdvices[] = $this->getIntroductionFromAdvisor($originalClass, $advisor, $advisorId);
                }
            }
        }
        if (count($classAdvices) > 0) {
            $classAdvices = array_merge_recursive(...$classAdvices);
        }

        return $classAdvices;
    }
public function getAdvicesForClass(ReflectionClass $class, array $advisors): array
    {
        $classAdvices = [];
        $parentClass  = $class->getParentClass();

        $originalClass = $class;
        if ($parentClass && strpos($parentClass->name, AspectContainer::AOP_PROXIED_SUFFIX) !== false) {
            $originalClass = $parentClass;
        }

        foreach ($advisors as $advisorId => $advisor) {
            if ($advisor instanceof Aop\PointcutAdvisor) {
                $pointcut = $advisor->getPointcut();
                if ($pointcut->getClassFilter()->matches($class)) {
                    $classAdvices[] = $this->getAdvicesFromAdvisor($originalClass, $advisor, $advisorId, $pointcut);
                }
            }

            if ($advisor instanceof Aop\IntroductionAdvisor) {
                if ($advisor->getClassFilter()->matches($class)) {
                    $classAdvices[] = $this->getIntroductionFromAdvisor($originalClass, $advisor, $advisorId);
                }
            }
        }
        if (count($classAdvices) > 0) {
            $classAdvices = array_merge_recursive(...$classAdvices);
        }

        return $classAdvices;
    }
public function getAdvicesForClass ( ReflectionClass $ class , array $ advisors ) : array { $ classAdvices = [ ] ; $ parentClass = $ class -> getParentClass ( ) ; $ originalClass = $ class ; if ( $ parentClass && strpos ( $ parentClass -> name , AspectContainer :: AOP_PROXIED_SUFFIX ) !== false ) { $ originalClass = $ parentClass ; } foreach ( $ advisors as $ advisorId => $ advisor ) { if ( $ advisor instanceof Aop \ PointcutAdvisor ) { $ pointcut = $ advisor -> getPointcut ( ) ; if ( $ pointcut -> getClassFilter ( ) -> matches ( $ class ) ) { $ classAdvices [ ] = $ this -> getAdvicesFromAdvisor ( $ originalClass , $ advisor , $ advisorId , $ pointcut ) ; } } if ( $ advisor instanceof Aop \ IntroductionAdvisor ) { if ( $ advisor -> getClassFilter ( ) -> matches ( $ class ) ) { $ classAdvices [ ] = $ this -> getIntroductionFromAdvisor ( $ originalClass , $ advisor , $ advisorId ) ; } } } if ( count ( $ classAdvices ) > 0 ) { $ classAdvices = array_merge_recursive ( ... $ classAdvices ) ; } return $ classAdvices ; }
Return list of advices for class

@param array|Aop\Advisor[] $advisors List of advisor to match

@return Aop\Advice[] List of advices for class
Return list of advices for class