File tree 1 file changed +4
-16
lines changed
1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -2901,7 +2901,7 @@ private function collectInheritedMembers(
2901
2901
$ parentsWithInheritedProperties [$ parentName ] = $ parent ;
2902
2902
}
2903
2903
2904
- if (!$ hasConstructor && $ parentInfo ->hasConstructor ()) {
2904
+ if (!$ hasConstructor && $ parentInfo ->hasNonPrivateConstructor ()) {
2905
2905
$ parentsWithInheritedMethods [$ parentName ]["name " ] = $ parent ;
2906
2906
$ parentsWithInheritedMethods [$ parentName ]["types " ][] = "constructorsynopsis " ;
2907
2907
}
@@ -2959,22 +2959,10 @@ private function hasConstructor(): bool
2959
2959
return false ;
2960
2960
}
2961
2961
2962
- /**
2963
- * @param array<string, ClassInfo> $classMap
2964
- */
2965
- private function hasParentConstructor (array $ classMap ): bool
2962
+ private function hasNonPrivateConstructor (): bool
2966
2963
{
2967
- foreach ($ this ->extends as $ parentName ) {
2968
- $ parent = $ classMap [$ parentName ->toString ()] ?? null ;
2969
- if ($ parent === null ) {
2970
- throw new Exception ("Missing parent class " . $ parent ->toString ());
2971
- }
2972
-
2973
- if ($ parent ->hasConstructor ()) {
2974
- return true ;
2975
- }
2976
-
2977
- if ($ parent ->hasParentConstructor ($ classMap )) {
2964
+ foreach ($ this ->funcInfos as $ funcInfo ) {
2965
+ if ($ funcInfo ->name ->isConstructor () && !($ funcInfo ->flags & Class_::MODIFIER_PRIVATE )) {
2978
2966
return true ;
2979
2967
}
2980
2968
}
You can’t perform that action at this time.
0 commit comments