-
Notifications
You must be signed in to change notification settings - Fork 36
add has-method #53
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
add has-method #53
Conversation
For |
So should I remove isValidName? I like this method because it allows me to do this:
without having the enum-class at hand. |
VS
I would prefere the first version (with method), it's less code to write and more explicit, imho. But you decide @marc-mabe. |
Damn scrutinizer won't succeed |
I don't see a real need for For
|
changed as requested |
$class = get_called_class(); | ||
$constants = self::detectConstants($class); | ||
$name = array_search($value, $constants, true); | ||
return $name !== false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return in_array($value, $constants, true);
done |
Please can you also address my small code comments and rebase all your commits together. |
I hope this is okay this time ;) |
No description provided.