respect-validation/library
Henrique Moody 1da164a26e
Change how "Sf" rule works
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>
2018-08-22 17:46:21 +02:00
..
Exceptions Change how "Sf" rule works 2018-08-22 17:46:21 +02:00
Helpers Fix issues after merging 1.1 2018-08-01 20:46:34 +02:00
Rules Change how "Sf" rule works 2018-08-22 17:46:21 +02:00
Factory.php Remove unnecessary validation from "Factory" class 2018-08-02 10:23:27 +02:00
Validatable.php Rename "Related" to "Child" 2018-08-02 11:18:33 +02:00
Validator.php Change how "Sf" rule works 2018-08-22 17:46:21 +02:00