Commit graph

17 commits

Author SHA1 Message Date
Alexandre Gomes Gaigalas ab3732f91f Use SPDX IDs for licensing
SPDX IDs are shorter than licensing notes previously used, and
adhere better to FOSS standards. It is also machine-readable.
2023-02-19 00:19:10 -03:00
Alexandre Gomes Gaigalas 15f148da24 Dusting off. See CHANGELOG.md for more details on this commit 2023-02-13 03:59:11 -03:00
Henrique Moody ef8a8f4b27
Turn LICENSE file into plain/text
There is no need for that file to be a Markdown, and it can be a plain
text file.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-05-23 16:21:34 +02:00
Henrique Moody f3bc39066b
Make default templates non-static and protected
The only reason why those templates are static is so users can overwrite
the exception messages. That was useful when we didn't have a handy
translator, but now that we can define a translator through the Factory,
this is not needed anymore.

Besides, having those properties public adds complexity to the code.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-05-12 09:57:07 +02:00
Henrique Moody 6040ddee42
Fix the case of the "@inheritDoc" tag
According to the official documentation [1] the correct way of writing
the "inheritDoc" tag is with the uppercase "D".

[1]: https://docs.phpdoc.org/guides/inheritance.html

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-04-05 19:02:12 +02:00
Henrique Moody 24c2ba8faa
Make "Min" always inclusive
Since the rule "GreaterThan" was created, there is no reason to allow
"Min" to not be inclusive.

Also apply contribution guidelines to the rule.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-05-31 17:14:23 +02:00
Henrique Moody 8c529c433e
Refactor ValidationException
Make the ValidationException a little bit less mutable than before. All
its dependencies are now passed into the constructor.

This commit also make the Factory pass the translator to the exceptions
allowing to define the translator before the exception gets created.
This change is not the ideal one, later I would like to not need the
Singleton from the Factory to do that, but for now it seems like a good
approach.

One more thing that this commit does is to introduce the "id" for
Exceptions. Key can be either the defined "name" or the name of the rule
that throwed the exception. This method will be handy to identify
exceptions better.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-05-27 16:12:05 +02:00
Henrique Moody d85668c359
Convert message keys to string
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-05-27 16:12:05 +02:00
Henrique Moody 5d0ecabfdc
Declare visibility for constants
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-05-27 16:12:05 +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
Andrew Peters 08a5ab0d81 Use "{less/greater} than or equal to" phrasing 2015-11-04 15:37:43 -02: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 e91d0ef22e Improve date and time handling on "Min" rule 2015-02-11 11:18:39 -02: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/MinException.php (Browse further)