Commit graph

1321 commits

Author SHA1 Message Date
Yosmany Garcia 8eb95c2b04
Updated provinces of Cuba
Updated provinces of Cuba according to the change of 2011
2017-01-26 15:38:38 +01:00
Michał Prochowski fa61315079
Czech and slovakia postal code patterns fix. 2017-01-26 15:37:37 +01:00
Renato Moura e4ae02fe94
Fix "Cnpj" rule 2017-01-25 17:41:21 +01:00
Pedro Manjarrez 527b1882dd Update README.md
Fixed typo on Exception types section.
2016-12-29 11:34:12 -06:00
Henrique Moody f82fcf0762
Prevent "Regex" to process non-string inputs 2016-10-29 15:21:14 +02:00
Henrique Moody bd636cc75e
Add support for "egulias/email-validator" 2.x 2016-10-29 15:20:13 +02:00
Henrique Moody 98050476c6
Always return a valid exception
If calling the method `getExceptionForPath()` when the exception was
nested but had no child it was returning null. This commit ensures that
it always return a valid exception.
2016-09-19 18:22:39 +02:00
Emmerson d0a98ae5d3
Date rule accepting scalar and DateTimeInterface 2016-09-19 10:13:01 +02:00
Gabriel Pedro a772d7f89a
Replace CNH validation algorithm
The old algorithm not working with some CNH values, e.g 00641829409.

You can even do some checking on
http://www.detran.pr.gov.br/modules/catasg/servicos-detalhes.php?tema=motorista&id=239.

Original algo can be found on
http://forum.imasters.com.br/topic/400293-validate-br.
2016-09-18 13:25:18 +02:00
Henrique Moody 8b32270d28
Add "symfony/polyfill-mbstring" as a dependency 2016-09-17 22:30:35 +02:00
Henrique Moody 4bcc4027f8
Try to use the getRelatedByName() method first
Then using the `findMessages()` method, tries to use the method
`getRelatedByName()` before using the `findRelated()` method.

This change was made because since on `KeyNested` rule you may have
names with '.' we'll never get the proper exception using
`findRelated()`.
2016-09-17 21:11:55 +02:00
Henrique Moody 98443bad0c
Get the proper exception when using findMessage() 2016-09-17 21:04:24 +02:00
Henrique Moody 494b67871f
Fix wrong behaviour on AbstractRelated
When you define the name for an `AbstractRelated` instance, you expect
that it also define the name for its child. But, when the child already
had a name the `AbstractRelated` was overwriting its name with the
`reference`.
2016-09-17 20:23:38 +02:00
Henrique Moody 7e88a7a0c8
Always check the type then executing KeyNested 2016-09-12 18:06:10 +02:00
Henrique Moody fb7f19f9ad Fix missing docblock for "iterableType" rule 2016-08-03 11:05:28 +02:00
Henrique Moody c044b8bb09 Cast integer to use with long2ip function 2016-08-03 10:43:33 +02:00
Henrique Moody e5fdd87a16 Rename "Iterable" to "IterableType" 2016-08-03 10:43:33 +02:00
Henrique Moody 8c49c6a75b Run PHP 7.1 on Travis 2016-08-03 09:41:33 +02:00
Marcel Prince 6597aa5114 Add method Identical To Validator.php 2016-05-07 20:51:56 +02:00
Henrique Moody 62316fc8b9 Merge branch '0.9' into 1.0 2016-05-05 13:14:24 +02:00
Mohammad Amiri 1ce8ac8c7e Update FilterVar.md
Fixed a mistake in Url validation examples
2016-05-05 13:12:45 +02:00
Emmerson d9a4c78b16 Fixes 'KeySet' rule when input is not array type 2016-05-05 13:01:04 +02:00
Henrique Moody 294368294f Merge branch '0.9' into 1.0 2016-03-31 14:39:15 -03:00
Henrique Moody 7d978d64e3 Merge branch '0.8' into 0.9 2016-03-31 14:26:10 -03:00
Henrique Moody eecc696792 Fix wrong date parsing on Date rule
The `DateTime::createFromFormat()` tries to guess the date too much and
sometimes wrong parsing may happen:

```php
echo DateTime::createFromFormat('Ym', '202309')->format('Ym');
```

The output of the above code is "202310", not "202309".

Using `date_parse_from_format()` we get a more precise parsing.
2016-03-31 14:18:22 -03:00
Henrique Moody 4b2f159206 Merge branch '0.9' into 1.0 2016-02-26 12:21:26 -03:00
Henrique Moody 7febcf3dd6 Merge branch '0.8' into 0.9 2016-02-26 12:20:26 -03:00
Alasdair North 3bf4957caf AbstractWrapper should pass on setName calls to the wrapped Validatable. 2016-02-26 12:18:05 -03:00
Henrique Moody 0c53645311 Better examples for PostalCode rule 2015-11-25 18:03:11 -02:00
Henrique Moody b85ed687f2 Merge branch '0.9' into 1.0 2015-11-25 17:59:49 -02:00
Henrique Moody d63cae970b Merge branch '0.8' into 0.9 2015-11-25 17:54:31 -02:00
Tomasz Regdos ecf4d5bb63 Fix PL postal code format 2015-11-25 17:44:59 -02:00
Henrique Moody e103a4ac88 Fix typo on the title 2015-11-13 13:18:29 -02:00
Henrique Moody 7aaa5c0a83 Merge branch '0.9' into 1.0 2015-11-06 12:25:14 -02:00
Henrique Moody bf5c0bf132 Merge branch '0.8' into 0.9 2015-11-06 12:19:53 -02:00
Felipe Martins e4622df22c PerfectSquare rule check if the sqrt is an integer 2015-11-06 12:11:15 -02:00
Henrique Moody 00c015c870 Merge branch '0.9' into 1.0 2015-11-04 15:16:26 -02:00
Henrique Moody c521918fd0 Merge branch '0.8' into 0.9 2015-11-04 15:13:07 -02:00
Kennedy Tedesco b98595a5c0 "MinimumAge" rule must accept any kind of integer 2015-11-04 15:08:10 -02:00
Emmerson 58461766e4 Improvements on Each rule and test classes. 2015-10-28 14:50:53 -02:00
Emmerson d579ce4efc CountryCode inherits from AbstractRule instead 2015-10-26 13:35:13 -02:00
Henrique Moody cd46545855 Small coding standards and docs improvements 2015-10-24 01:32:07 -02:00
Henrique Moody 474afaa2ec Remove "ValidationExceptionInterface" 2015-10-23 09:00:31 -02:00
Henrique Moody 67e072ebd3 Remove "NestedValidationExceptionInterface" 2015-10-23 09:00:18 -02:00
Henrique Moody 04db93bdad Remove prefix "Abstract" of non-abstract classes 2015-10-23 09:00:08 -02:00
Diego Oliveira 70997912eb Create "Imei" rule 2015-10-23 07:53:59 -02:00
Alexandre Gaigalas 84fa389d4c Implements numeric Key/KeyNested Addressing
The Key and KeyNested rules didn't supported numeric
addressing (e.g. `v::key(42);`). This change implements it and
adds new tests for the behavior.
2015-10-22 10:35:58 -02:00
Henrique Moody 19698d6a38 Move rule integration tests do another directory 2015-10-22 03:22:58 -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
Edson Lima fd6fcd151e Create integration tests for "AllOf" rule 2015-10-21 10:27:22 -02:00