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 (@param ?string $rpcParamName) #13

Open
TysonAndre opened this issue Oct 21, 2017 · 4 comments · May be fixed by #50
Open

Support nullable types (@param ?string $rpcParamName) #13

TysonAndre opened this issue Oct 21, 2017 · 4 comments · May be fixed by #50

Comments

@TysonAndre
Copy link
Contributor

It's annoying and surprising to have to type @param string|null instead of @param ?string.

Checking if the first character of a type is ? and stripping that (and adding null) may be the quickest workaround, not sure if upgrading dependencies would help.

https://github.com/phpDocumentor/TypeResolver/ issue 31 seems related, phpdocumentor2 (project) does parse these.

@felixfbecker
Copy link
Owner

I've never seen that syntax before. Could you point me to docs about it?

@TysonAndre
Copy link
Contributor Author

Filed phpDocumentor/fig-standards#153

This is something that would make sense to me, but sadly not part of official standards yet.

  • Didn't see anything in the mailing list for fig.
  • PSR-5 doesn't include it, PSR-5 draft also hasn't been updated recently.

@VolCh
Copy link

VolCh commented Jan 5, 2018

@felixfbecker it is PHP7.1 nullable type declaration for parameters and return values syntax: PHP manual

@felixfbecker
Copy link
Owner

@VolCh this package only looks at @param tags

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

Successfully merging a pull request may close this issue.

3 participants