Skip to content

Return type of getValues() #36

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

Closed
holtkamp opened this issue Aug 1, 2016 · 3 comments
Closed

Return type of getValues() #36

holtkamp opened this issue Aug 1, 2016 · 3 comments

Comments

@holtkamp
Copy link
Contributor

holtkamp commented Aug 1, 2016

Currently the PHPDoc return type of getValues() is an array.

Would it be an idea to change that to:

/**
 * @return Enum[]
 */

This would allow proper code completion, for example:

foreach(Locales::getValues() as $locale){
    echo $locale->getValue(); //This currently results in a warning
}
@mnapoli
Copy link
Member

mnapoli commented Aug 1, 2016

👍 I'm all for that

@holtkamp
Copy link
Contributor Author

holtkamp commented Aug 1, 2016

Hehe, quick reaction, maybe even

/**
 * @return static[]
 */

Not sure how well supported that is... Will check it out and provide a PR.

@mnapoli
Copy link
Member

mnapoli commented Aug 1, 2016

Fixed by #37

@mnapoli mnapoli closed this as completed Aug 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants