-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PropertyInfo] Fix dock block lookup fallback loop #27837
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
Thanks for the PR and the clear description. Could you add a test case please? |
Ah, looks like i rebased on master, not 4.1 ... is there an easy fix for this or is it better to create a new PR, I wonder? |
// No valid doc block | ||
} | ||
|
||
return null; |
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.
You can return in the catch (same below)
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.
Was wondering ... I guess that a personal preference thing for me. I always feel it looks weird to not have a return at the end if the return type is not void.
This PR was merged into the 3.4 branch. Discussion ---------- Replaced AppBundle mentions with App | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Removed some legacy non-test related mentions of AppBundle. Probably this should be done for 4.x only, not >=3.4. Commits ------- b455237 AppBundle->App.
Thank you @DerManoMann. |
…oMann) This PR was submitted for the 4.1 branch but it was squashed and merged into the 3.4 branch instead (closes #27837). Discussion ---------- [PropertyInfo] Fix dock block lookup fallback loop | Q | A | ------------- | --- | Branch? | 4.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | `getDocBlock()` in `PhpDocExtractor` implements a fallback loop when trying to lookup a dock block for a property (property, accessor method, mutator method). This relies on the individual lookups to return `null`. Unfortunately, phpDocumentor will throw an `InvalidArgumentException` exception in case there is no dock block. Currently the try/catch is wrapping the whole loop which means if the first lookup fails the loop is ended instead of moving on to the next one. This PR moves the try/catch to each individual call of `$this->docBlockFactory->create()`. Commits ------- b1a6120 [PropertyInfo] Fix dock block lookup fallback loop
Merged on branch 3.4 by the way. |
getDocBlock()
inPhpDocExtractor
implements a fallback loop when trying to lookup a dock block for a property (property, accessor method, mutator method). This relies on the individual lookups to returnnull
.Unfortunately, phpDocumentor will throw an
InvalidArgumentException
exception in case there is no dock block.Currently the try/catch is wrapping the whole loop which means if the first lookup fails the loop is ended instead of moving on to the next one.
This PR moves the try/catch to each individual call of
$this->docBlockFactory->create()
.