private function getIntroductionFromAdvisor(
        ReflectionClass $class,
        Aop\IntroductionAdvisor $advisor,
        string $advisorId
    ): array {
        $classAdvices = [];
        // Do not make introduction for traits
        if ($class->isTrait()) {
            return $classAdvices;
        }

        /** @var Aop\IntroductionInfo $introduction */
        $introduction    = $advisor->getAdvice();
        $introducedTrait = $introduction->getTrait();
        if (!empty($introducedTrait)) {
            $introducedTrait = '\\' . ltrim($introducedTrait, '\\');

            $classAdvices[AspectContainer::INTRODUCTION_TRAIT_PREFIX][$advisorId] = $introducedTrait;
        }
        $introducedInterface = $introduction->getInterface();
        if (!empty($introducedInterface)) {
            $introducedInterface = '\\' . ltrim($introducedInterface, '\\');

            $classAdvices[AspectContainer::INTRODUCTION_INTERFACE_PREFIX][$advisorId] = $introducedInterface;
        }

        return $classAdvices;
    }
private function getIntroductionFromAdvisor(
        ReflectionClass $class,
        Aop\IntroductionAdvisor $advisor,
        string $advisorId
    ): array {
        $classAdvices = [];
        // Do not make introduction for traits
        if ($class->isTrait()) {
            return $classAdvices;
        }

        /** @var Aop\IntroductionInfo $introduction */
        $introduction    = $advisor->getAdvice();
        $introducedTrait = $introduction->getTrait();
        if (!empty($introducedTrait)) {
            $introducedTrait = '\\' . ltrim($introducedTrait, '\\');

            $classAdvices[AspectContainer::INTRODUCTION_TRAIT_PREFIX][$advisorId] = $introducedTrait;
        }
        $introducedInterface = $introduction->getInterface();
        if (!empty($introducedInterface)) {
            $introducedInterface = '\\' . ltrim($introducedInterface, '\\');

            $classAdvices[AspectContainer::INTRODUCTION_INTERFACE_PREFIX][$advisorId] = $introducedInterface;
        }

        return $classAdvices;
    }
private function getIntroductionFromAdvisor ( ReflectionClass $ class , Aop \ IntroductionAdvisor $ advisor , string $ advisorId ) : array { $ classAdvices = [ ] ; // Do not make introduction for traits if ( $ class -> isTrait ( ) ) { return $ classAdvices ; } /** @var Aop\IntroductionInfo $introduction */ $ introduction = $ advisor -> getAdvice ( ) ; $ introducedTrait = $ introduction -> getTrait ( ) ; if ( ! empty ( $ introducedTrait ) ) { $ introducedTrait = '\\' . ltrim ( $ introducedTrait , '\\' ) ; $ classAdvices [ AspectContainer :: INTRODUCTION_TRAIT_PREFIX ] [ $ advisorId ] = $ introducedTrait ; } $ introducedInterface = $ introduction -> getInterface ( ) ; if ( ! empty ( $ introducedInterface ) ) { $ introducedInterface = '\\' . ltrim ( $ introducedInterface , '\\' ) ; $ classAdvices [ AspectContainer :: INTRODUCTION_INTERFACE_PREFIX ] [ $ advisorId ] = $ introducedInterface ; } return $ classAdvices ; }
Returns list of introduction advices from advisor
Returns list of introduction advices from advisor