Skip to content
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

Inherit method documentation through multiple generations #3701

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

smaddock
Copy link

@smaddock smaddock commented Apr 15, 2024

Fixes #2717

@smaddock
Copy link
Author

smaddock commented Apr 18, 2024

Just pasting here so it's easy to find.

Error: PHP Fatal error: Uncaught Error: Call to undefined method phpDocumentor\Reflection\Fqsen::getMethods() in /home/runner/work/phpDocumentor/phpDocumentor/src/phpDocumentor/Descriptor/MethodDescriptor.php:265

Code

Check log

@jaapio
Copy link
Member

jaapio commented Apr 24, 2024

The error you get is because of the design of the descriptors. The workflow is as following.

First we parse all files in a project one by one. If that's done we transform the output of the parsing to descriptors. The links between classes, namepaces ect. are not part of the descriptors at this moment. This allows us to cache the descriptors without to much complexity because the linked objects will have bi-directional relationships.

The next step is to link all objects (replace the FQSEN objects) if this cannot be done (because the actual descriptor doesn't exist) the FQSEN remains part of the list.

So when iterating over the interfaces, you need to check if the returned object is an instance of a InterfaceDescriptorInterface

@smaddock smaddock changed the title Fixes #2717 Inherit method documentation through multiple generations Apr 24, 2024
@smaddock
Copy link
Author

Oh, the error is in my unit test. Fixing...

@smaddock
Copy link
Author

Okay, I think this will pass all the checks now, but it won't solve issue #2717 until issue #3706 is also fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inherit docblock method from interface thru abstract class
2 participants