mirror of
https://github.com/Respect/Validation.git
synced 2024-06-26 17:20:16 +02:00
Instead of creating the Symfony constraints itself "Sf" accepts an instance of "Symfony\Component\Validator\Constraint". Creating objects inside a rule, specially from an external library, makes the rule too complex and also limits the possibilities with the "Sf" rule since Symfony allows users to create complex validations (even thought their API is not as simple as ours). This commit also simplifies the way the messages are passed from Symfony to the "Sf" when only one constraint has failed; instead of passing the message of the whole constraint violation list, only the fist constraint violation message it passed. The problem that this rule will always have is that when using "Not" to invert the validation we have a way to get a proper message since Symfony Validator only return the result of constraints that failed. That's something the Respect\Validation does in a similar way and to change it a lot has to be changed. These changes were checked in "symfony/validator" 4.0 and the version was added to the "composer.json" file. Signed-off-by: Henrique Moody <henriquemoody@gmail.com> |
||
---|---|---|
docs | ||
library | ||
tests | ||
.docheader | ||
.gitattributes | ||
.gitignore | ||
.php_cs | ||
.scrutinizer.yml | ||
.travis.yml | ||
CHANGELOG.md | ||
composer.json | ||
CONTRIBUTING.md | ||
couscous.yml | ||
LICENSE.md | ||
phpunit.xml.dist | ||
README.md |
Respect\Validation
The most awesome validation engine ever created for PHP.
- Complex rules made simple:
v::numericVal()->positive()->between(1, 255)->validate($input)
. - Granularity control for advanced reporting.
- More than 130 (fully tested) validation rules.
- A concrete API for non fluent usage.