Commit graph

11 commits

Author SHA1 Message Date
Henrique Moody cc20a442a1
Apply "SlevomatCodingStandard.TypeHints.DeclareStrictTypes"
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-02-09 14:11:12 +01:00
Henrique Moody 111b3de436
Apply "PEAR.WhiteSpace.ObjectOperatorIndent"
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-02-09 14:08:23 +01:00
Henrique Moody fbaf78fc39
Replace the usages of "--EXPECTF--" by "--EXPECT--"
The "--EXPECTF--" is supposed to be used when the output of "--FILE--"
is random. In many cases, we are using "--EXPECTF--" section while we
could use "--EXPECT--" instead.

This commit will replace the usages of "--EXPECTF--" by "--EXPECT--"
when the output does "--FILE--" is not random.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-12-19 18:05:58 +01:00
Henrique Moody df3f1c0ea7
Add "CREDITS" section to PHPT files
All the PHP files have the "@author" annotation to make clear which
people have contributed to that specific file, however, there is no such
thing in the PHPT files.

This commit will add the "CREDITS" section to the PHPT files. The list
of authors is created from the output of the `git blame` command.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-11-30 09:25:42 +01:00
Henrique Moody 0338e18e83
Rename rule "Date" to "DateTime"
Also change rules to use `DateTimeInterface` and `DateTimeImmutable`
when possible.
2017-05-01 13:16:59 +02:00
Henrique Moody 67e072ebd3 Remove "NestedValidationExceptionInterface" 2015-10-23 09:00:18 -02:00
Henrique Moody 8c9c587597 Improvements and fixes on exceptions
There were some cases when the exceptions was not displayed property
when using nested exception, this commit fix the problem and also
display messages in Markdown list.
2015-10-22 03:01:41 -02:00
Henrique Moody 9c49dd3bcf Use short array syntax 2015-10-17 22:56:32 -03:00
Henrique Moody 5a41a6bf0c Make exception messages simpler
When the exception has only one related exception, there is no need to
display it's messages unless it has an user-defined template.
2015-09-11 02:49:42 -03:00
Henrique Moody 748b280c34 Update conversion to strings on exceptions
Many changes were made on `ValidationException::stringify`:
- Add support for instances of `Exception`;
- Add support for instances of `Traversable`;
- Add support for resources;
- Improve `Array` conversion;
- Improve `Object` conversion;
- Improve conversion of all values by using JSON.

Now, all the parameters of the exception classes are just converted to
string when replacing parameters on exceptions, so the exception classes
now keep the original value of all parameters.
2015-09-04 17:11:40 -03:00
Henrique Moody 4037209302 Move some tests from ValidatorTest to PHPT files
- setTemplate() with single validator should use template as main
  message
- setTemplate() with multiple validators should use template as main
  message
- setTemplate() with multiple validators should use template as full
  message
- getFullMessage() should include all validation messages in a chain
- not() should work by builder
- countryCode()
- alwaysValid()
- alwaysInvalid()
- Issue #85: findMessages() should not trigger catchable fatal error
- keys as validator names
- Do not rely on nested validation exception interface for check
2015-07-29 01:19:00 -03:00