File tree Expand file tree Collapse file tree 1 file changed +4
-16
lines changed
Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -2901,7 +2901,7 @@ private function collectInheritedMembers(
29012901 $ parentsWithInheritedProperties [$ parentName ] = $ parent ;
29022902 }
29032903
2904- if (!$ hasConstructor && $ parentInfo ->hasConstructor ()) {
2904+ if (!$ hasConstructor && $ parentInfo ->hasNonPrivateConstructor ()) {
29052905 $ parentsWithInheritedMethods [$ parentName ]["name " ] = $ parent ;
29062906 $ parentsWithInheritedMethods [$ parentName ]["types " ][] = "constructorsynopsis " ;
29072907 }
@@ -2959,22 +2959,10 @@ private function hasConstructor(): bool
29592959 return false ;
29602960 }
29612961
2962- /**
2963- * @param array<string, ClassInfo> $classMap
2964- */
2965- private function hasParentConstructor (array $ classMap ): bool
2962+ private function hasNonPrivateConstructor (): bool
29662963 {
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 )) {
29782966 return true ;
29792967 }
29802968 }
You can’t perform that action at this time.
0 commit comments