-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PropertyInfo] added handling of nullable types in PhpDoc #27618
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
Okay, so the tests fail because |
Given 0.3 supports 5.5, which is the minimum version of Symfony 3.4, I think it's fine bumping. |
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.
bump pending :)
While not specified in PSR-5, PhpDocumentor does support parsing nullable types in the PHP 7.1 syntax (i.e. ?string), and returns those in a Nullable wrapper. We currently don't handle this and neither throw an error, which results in all kind of weird breakage when this syntax is used (e.g. "class string|int not found"). Correctly parse this syntax into a nullable type.
@nicolas-grekas I fixed the dependency (& tests are working now) :) |
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.
Nice one, thanks!
Thank you @oxan. |
…(oxan) This PR was merged into the 3.4 branch. Discussion ---------- [PropertyInfo] added handling of nullable types in PhpDoc While not specified in PSR-5, PhpDocumentor does support parsing nullable types in the PHP 7.1 syntax (i.e. `?string`), and returns those in a `Nullable` wrapper type. We currently don't handle this and neither throw an error, which results in all kind of weird breakage when this syntax is used (e.g. "class string|int not found"). Correctly parse this syntax into a nullable type. | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- 38b369b [PropertyInfo] added handling of nullable types in PhpDoc
While not specified in PSR-5, PhpDocumentor does support parsing nullable types in the PHP 7.1 syntax (i.e.
?string
), and returns those in aNullable
wrapper type. We currently don't handle this and neither throw an error, which results in all kind of weird breakage when this syntax is used (e.g. "class string|int not found").Correctly parse this syntax into a nullable type.