-
Notifications
You must be signed in to change notification settings - Fork 157
Pass message from methods to integer assertion inside #335
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
I agree, that was an oversight. The Would you please update all cases? We should also have unit testing around this. |
|
Ok, I will add this to other methods as well. And will check tests as well. |
|
@shadowhand so, after checking everything I have some questions 😅
Theoretically, some specific message could be provided by library itself, like in What do you think is more suitable?
|
|
@alexsoft ah yes, this is probably why we have not passed the custom message up through to self-assertions, the message context can get too vague or outright inaccurate. Perhaps it would be better to return to your original (smaller) scope, and address other validations in groups as you have energy for. |
|
@shadowhand Can I keep anything else from this PR? Out of all methods that I changed, I would definitely keep changes in And definitely reverse changes in I am only not 100% sure about What do you think? |
|
And what about this?
|
|
@alexsoft ah, regarding |
…ts, directory, readable, writable
Please have a look, @shadowhand |
|
Released in version 2.1.0. |
|
Thank you for help! |
Previously in v1,
positiveIntegerwas using!(\is_int($value) && $value > 0)condition. If custom message was passed, it worked correctly. Now before comparing to 0,self::integeris called, but message is not passed to that call.In my opinion, it is wrong, that's why I created this PR.
I think the same should be done in newly introduced
negativeIntegerandnonNegativeInteger, so I added this there too.Maybe, similar should be done in other methods where other methods are also called. But I decided to let that be done by maintainers. Or let me know, I can add to other methods as well.