-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
phpDoc variable, attribute, param possible value suggestion #77
Comments
This sounds to me like how an IDE implementation would behave based on autocompletion of tag writing... and thus doesn't involve the spec itself. Ping @ondrejmirtes @muglug @neuro159 @mindplay-dk @GaryJones @mvriel @jaapio for opinions... does it sound this way to you? |
Somewhat related: Phan and Psalm both have support for
https://github.com/vimeo/psalm/blob/master/docs/typing_in_psalm.md#specifying-stringint-options-aka-enums |
I'd be open to looking more into the |
This is an old feature request for PhpStorm - https://youtrack.jetbrains.com/issue/WI-854 - and we are finally working to make it happen (one way or another). We have planned to make use of parameterized types, something like |
In my experience, not terribly much in the places we use this syntax in Vimeo’s codebase. Often it’s just an explicit form of an existing docblock comment: |
Hmm, so allowing for literals and constants in areas where we currently limit it to types and classes... almost always in a union string, but for simplicity can perhaps just open all the type/class areas up to allow literals/constants. Any concerns with this approach? |
In theory we MAY allow everything that's considered constant value in PHP (*). This would allow for example to use constant references as well, i.e. sth like Global constants would conflict with class names, so probably only class constants could be allowed. (*) See PHPStan's ABNF grammar for constant expression |
If this needs to be pursued further, please bring this up as a new thread on the FIG mailing list for discussion -- https://groups.google.com/forum/#!forum/php-fig |
Hello,
I would like to suggest to make possible values list for @param, @Property and etc phpDoc tags it would really help on autocompleting in normal IDE like PHPStorm. Kinda like this:
Example What I imagine:
Real life example is PHPStorm Symfony2 Plugin which suggest possible values for container, route, doctrine repositories, entities and other thing by tagging function param with special tag.
The text was updated successfully, but these errors were encountered: