File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -104,26 +104,27 @@ private function callsParentConstruct(Node $parserNode): bool
104
104
*/
105
105
private function getParentConstructorClass ($ classReflection )
106
106
{
107
- while ($ classReflection ->getParentClass () !== false ) {
108
- $ constructor = $ classReflection ->getParentClass ()->hasMethod ('__construct ' ) ? $ classReflection ->getParentClass ()->getMethod ('__construct ' ) : null ;
109
- $ constructorWithClassName = $ classReflection ->getParentClass ()->hasMethod ($ classReflection ->getParentClass ()->getName ()) ? $ classReflection ->getParentClass ()->getMethod ($ classReflection ->getParentClass ()->getName ()) : null ;
107
+ $ parentClass = $ classReflection ->getParentClass ();
108
+ while ($ parentClass !== false ) {
109
+ $ constructor = $ parentClass ->hasMethod ('__construct ' ) ? $ parentClass ->getMethod ('__construct ' ) : null ;
110
+ $ constructorWithClassName = $ parentClass ->hasMethod ($ parentClass ->getName ()) ? $ parentClass ->getMethod ($ parentClass ->getName ()) : null ;
110
111
if (
111
112
(
112
113
$ constructor !== null
113
- && $ constructor ->getDeclaringClass ()->getName () === $ classReflection -> getParentClass () ->getName ()
114
+ && $ constructor ->getDeclaringClass ()->getName () === $ parentClass ->getName ()
114
115
&& !$ constructor ->isAbstract ()
115
116
&& !$ constructor ->isPrivate ()
116
117
&& !$ constructor ->isDeprecated ()
117
118
) || (
118
119
$ constructorWithClassName !== null
119
- && $ constructorWithClassName ->getDeclaringClass ()->getName () === $ classReflection -> getParentClass () ->getName ()
120
+ && $ constructorWithClassName ->getDeclaringClass ()->getName () === $ parentClass ->getName ()
120
121
&& !$ constructorWithClassName ->isAbstract ()
121
122
)
122
123
) {
123
- return $ classReflection -> getParentClass () ;
124
+ return $ parentClass ;
124
125
}
125
126
126
- $ classReflection = $ classReflection ->getParentClass ();
127
+ $ parentClass = $ parentClass ->getParentClass ();
127
128
}
128
129
129
130
return false ;
You can’t perform that action at this time.
0 commit comments