@@ -49,7 +49,7 @@ public function __construct(bool $isInterceptFunctions = false)
4949 *
5050 * @param Aop\Advisor[] $advisors List of advisor to match
5151 *
52- * @return Aop\Advice[] List of advices for class
52+ * @return Aop\Advice[][][] List of advices for function
5353 */
5454 public function getAdvicesForFunctions (ReflectionFileNamespace $ namespace , array $ advisors ): array
5555 {
@@ -81,7 +81,7 @@ public function getAdvicesForFunctions(ReflectionFileNamespace $namespace, array
8181 *
8282 * @param array|Aop\Advisor[] $advisors List of advisor to match
8383 *
84- * @return Aop\Advice[][] List of advices for class
84+ * @return Aop\Advice[][][] List of advices for class
8585 */
8686 public function getAdvicesForClass (ReflectionClass $ class , array $ advisors ): array
8787 {
@@ -103,7 +103,7 @@ public function getAdvicesForClass(ReflectionClass $class, array $advisors): arr
103103
104104 if ($ advisor instanceof IntroductionAdvisor) {
105105 if ($ advisor ->getClassFilter ()->matches ($ class )) {
106- $ classAdvices [] = $ this ->getIntroductionFromAdvisor ($ originalClass , $ advisor, $ advisorId );
106+ $ classAdvices [] = $ this ->getIntroductionFromAdvisor ($ originalClass , $ advisor );
107107 }
108108 }
109109 }
@@ -172,11 +172,12 @@ private function getAdvicesFromAdvisor(
172172
173173 /**
174174 * Returns list of introduction advices from advisor
175+ *
176+ * @return Aop\IntroductionInfo[][][]
175177 */
176178 private function getIntroductionFromAdvisor (
177179 ReflectionClass $ class ,
178- IntroductionAdvisor $ advisor ,
179- string $ advisorId
180+ IntroductionAdvisor $ advisor
180181 ): array {
181182 $ classAdvices = [];
182183 // Do not make introduction for traits
@@ -190,13 +191,13 @@ private function getIntroductionFromAdvisor(
190191 if (!empty ($ introducedTrait )) {
191192 $ introducedTrait = '\\' . ltrim ($ introducedTrait , '\\' );
192193
193- $ classAdvices [AspectContainer::INTRODUCTION_TRAIT_PREFIX ][$ advisorId ] = $ introducedTrait ;
194+ $ classAdvices [AspectContainer::INTRODUCTION_TRAIT_PREFIX ][' root ' ][ $ introducedTrait ] = $ introduction ;
194195 }
195196 $ introducedInterface = $ introduction ->getInterface ();
196197 if (!empty ($ introducedInterface )) {
197198 $ introducedInterface = '\\' . ltrim ($ introducedInterface , '\\' );
198199
199- $ classAdvices [AspectContainer::INTRODUCTION_INTERFACE_PREFIX ][$ advisorId ] = $ introducedInterface ;
200+ $ classAdvices [AspectContainer::INTRODUCTION_INTERFACE_PREFIX ][' root ' ][ $ introducedInterface ] = $ introduction ;
200201 }
201202
202203 return $ classAdvices ;
0 commit comments