Commit graph

7 commits

Author SHA1 Message Date
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
Henrique Moody
ef975629f3
Changes on PHP-CS-Fixer configuration
Because of `declare(strict_types=1)` some changes were necessary.
2018-01-04 17:59:37 +01:00
Henrique Moody
9c49dd3bcf Use short array syntax 2015-10-17 22:56:32 -03:00
Henrique Moody
a3c945aa51 Add license information and copyright in all files 2015-06-08 12:09:25 -03:00
Henrique Moody
b8c76e3054 Fix some coding standards 2015-06-08 11:51:45 -03:00
Henrique Moody
da193b75e0 Use PSR-2 standard
Most changes was made by php-cs-fixer.
Also removes unused `RecursiveTreeIterator` class.
2015-01-08 00:44:12 -02:00
Graham Campbell
ae056920b4 PSR-4 autoloading 2014-07-12 20:20:43 +01:00
Renamed from library/Respect/Validation/Exceptions/SfException.php (Browse further)