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

Support nullable types #19

Closed
weierophinney opened this issue Dec 31, 2019 · 6 comments · Fixed by #58
Closed

Support nullable types #19

weierophinney opened this issue Dec 31, 2019 · 6 comments · Fixed by #58
Assignees
Labels
Enhancement Won't Fix This will not be worked on
Milestone

Comments

@weierophinney
Copy link
Member

As per PHP 7.1, it is possible to define nullability of a type by adding a ? in front of it ( https://wiki.php.net/rfc/nullable_types ).

A few heads-up:

  • careful about ?Foo $bar = null vs ?Foo $bar vs Foo $bar = null
  • need to eventually patch the TypeGenerator to include the ? in it (not sure yet)

Originally posted by @Ocramius at zendframework/zend-code#85

@weierophinney
Copy link
Member Author

Surely resolving the fact that Zend\Code\Scanner\MethodScanner doesn't properly handle scalar type declarations should come before supporting nullable types? #56 still hasn't received any acknowledgement.


Originally posted by @djmattyg007 at zendframework/zend-code#85 (comment)

@weierophinney
Copy link
Member Author

@djmattyg007 I reported the issue completely independently from other issues.


Originally posted by @Ocramius at zendframework/zend-code#85 (comment)

@weierophinney
Copy link
Member Author

My point was that PHP 7.0 compatibility should be targeted before PHP 7.1 compatibility.


Originally posted by @djmattyg007 at zendframework/zend-code#85 (comment)

@weierophinney
Copy link
Member Author

Ah yes, that is because the codegen part of this component is already 7.0 compatible. I hardly ever use the scanner, as it is not AST-based (which makes it very unstable)


Originally posted by @Ocramius at zendframework/zend-code#85 (comment)

@weierophinney
Copy link
Member Author

If no one is maintaining the scanning code, shouldn't it be removed?


Originally posted by @djmattyg007 at zendframework/zend-code#85 (comment)

@Ocramius
Copy link
Member

No longer needed as per #58

@Ocramius Ocramius added this to the 4.0.0 milestone Nov 30, 2020
@Ocramius Ocramius self-assigned this Nov 30, 2020
@Ocramius Ocramius added the Won't Fix This will not be worked on label Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Won't Fix This will not be worked on
Projects
None yet
2 participants