You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In early versions of this library, we did support the native nullable types of PHP. (e.g ?string).
The new version of our parser based on phpstan/phpdoc-parser does not support this properly. The main reason is because it might lead to non-obvious notations in situations where union types are used. ?string|int is equal to null|string|int. There is no difference between a null for a string or int.
It is easy to overlook the ?. And since PHP does have native union type support that also errors with this legacy notation it's better to move away from this format.
Dropping this support will help us to remove some complex parsing form our code.
The text was updated successfully, but these errors were encountered:
About the use of ? I already commented on libraries to say it's non standard to use it in phpdoc.
But nobody cares, is phpdoc standard defined somewhere?
The answers where that phpstan and other tools supported ? so we can use it.
For me it looks like a deviation of the spec.
What do you think ?
In early versions of this library, we did support the native nullable types of PHP. (e.g
?string
).The new version of our parser based on phpstan/phpdoc-parser does not support this properly. The main reason is because it might lead to non-obvious notations in situations where union types are used.
?string|int
is equal tonull|string|int
. There is no difference between anull
for astring
orint
.It is easy to overlook the
?
. And since PHP does have native union type support that also errors with this legacy notation it's better to move away from this format.Dropping this support will help us to remove some complex parsing form our code.
The text was updated successfully, but these errors were encountered: