-
Notifications
You must be signed in to change notification settings - Fork 30
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
Slim 4 support route params #56
base: master
Are you sure you want to change the base?
Conversation
Please update for slim 4 support and also respect version to 2 Thanks,
Need to update php unit tests |
Hi @M-Shahbaz. Are you still working on this PR? |
@DavidePastore updated and All checks have passed. |
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.
Hi @M-Shahbaz, thanks for your effort on this PR. I reviewed it. Please, let me know if you need further explanations.
]; | ||
|
||
/** | ||
* The translator to use for the exception message. | ||
* | ||
* @var callable | ||
* @var array |
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.
Why is $translator
defined as an array?
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.
$exception->setParam('translator', $this->translator);
callable setParam
not available in v2.0+ of Respect/Validation
Converted to custom messages using array: https://github.com/Respect/Validation/blob/master/docs/feature-guide.md#custom-messages
@@ -70,7 +75,7 @@ class Validation | |||
* Create new Validator service provider. | |||
* | |||
* @param null|array|ArrayAccess $validators | |||
* @param null|callable $translator | |||
* @param null|array $translator |
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.
Why is $translator
defined as an array?
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.
$exception->setParam('translator', $this->translator);
callable setParam
not available in v2.0+ of Respect/Validation
Converted to custom messages using array: https://github.com/Respect/Validation/blob/master/docs/feature-guide.md#custom-messages
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.
You can now translate messages using the withTranslator
method.
use Respect\Validation\Validator as v; | ||
|
||
class ValidationTest extends \PHPUnit_Framework_TestCase | ||
class ValidationTest extends TestCase |
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 file is missing a lot of tests that was previously available. Why were they removed?
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.
I was only able to make these tests work with Slim 4. Maybe you can add more tests as we now have Slim 4 bootstrap.
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.
Unfortunately these tests are important and should be part of the middleware.
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.
Please, fix the conflicts of composer.lock
file.
No description provided.