-
Notifications
You must be signed in to change notification settings - Fork 24
Enable custom validator on Option #50
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
Conversation
|
Thanks The reason that phpunit was not added to the composer.json is that, I usually run the phpunit phar file directly |
|
Ah, I see. Fair enough. I think for contributors it's easier to include it, but it's not that much of a hassle to install it in the project locally and just not commit it. |
|
you can add it to the dev dependency if it's more convenient |
1 similar comment
|
@ErikBooij I just tagged a release for this fix https://github.com/c9s/GetOptionKit/releases/tag/2.5.1 |
| } | ||
| } | ||
|
|
||
| if (!$this->validate($value)[0]) { |
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.
This change breaks compatibility with PHP 5.3 which is still declared in composer.json. @c9s do you want to bump PHP requirements or fix this issue?
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.
@morozov shall we use an extra variable to improve the compatibility?
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.
Yes, I believe it will work.
The customer
validatoryou could set on anOptionwasn't triggered during option parsing, this required you to call$option->validate($option->value))manually, which is cumbersome and counterintuitive.Sidenote: I noticed PHPUnit wasn't included as a dependency in
composer.json, any reason for that? It's hard to run the unit tests that way ;-)