php-advanced-json-rpc
php-advanced-json-rpc copied to clipboard
Support nullable types (`@param ?string $rpcParamName`)
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.
I've never seen that syntax before. Could you point me to docs about it?
Filed https://github.com/phpDocumentor/fig-standards/issues/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.
@felixfbecker it is PHP7.1 nullable type declaration for parameters and return values syntax: PHP manual
@VolCh this package only looks at @param tags