-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix class synopsis generation #7891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -1558,14 +1558,14 @@ public function getFieldSynopsisElement(DOMDocument $doc): DOMElement | |||
} | |||
|
|||
private function getFieldSynopsisType(): Type { | |||
if ($this->type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a readonly mixed
property which is indeed a resource
. On the contrary, the real type is displayed for params and returns because their PHPDoc type hint is usually invalid (e.g. true
, false|null
etc.)
@@ -2019,10 +2019,6 @@ public static function getClassSynopsisReference(Name $name): string { | |||
*/ | |||
private function collectInheritedMembers(array &$parentsWithInheritedProperties, array &$parentsWithInheritedMethods, array $classMap): void | |||
{ | |||
if ($this->type !== "class") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usually, inherited members of interfaces are also displayed in the manual
@@ -2033,7 +2029,7 @@ private function collectInheritedMembers(array &$parentsWithInheritedProperties, | |||
$parentsWithInheritedProperties[$parent->toString()] = $parent; | |||
} | |||
|
|||
if (!empty($parentInfo->funcInfos) && !isset($parentsWithInheritedMethods[$parent->toString()])) { | |||
if (!isset($parentsWithInheritedMethods[$parent->toString()]) && $parentInfo->hasMethods()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on the other hand, constructors are usually not displayed as inherited members.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you!
These are a few fixes which were necessary for me to do when syncing stubs with the docs.