Commit graph

865 commits

Author SHA1 Message Date
Henrique Moody b8c76e3054 Fix some coding standards 2015-06-08 11:51:45 -03:00
Henrique Moody 124ac05e02 Merge branch '0.9' 2015-06-06 10:09:05 -03:00
Henrique Moody 403b80e92c Merge branch '0.8' into 0.9 2015-06-06 10:06:25 -03:00
Henrique Moody aaca258bed Merge pull request #355 from henriquemoody/symfony
Pin "symfony/validator" version on 2.6.x
2015-06-06 10:03:35 -03:00
Henrique Moody 7223973112 Pin "symfony/validator" version on 2.6.x 2015-06-06 09:55:19 -03:00
Henrique Moody 2c2c838c1a Merge branch '0.9' 2015-05-28 11:32:58 -03:00
Henrique Moody d0f36de3bd Merge branch '0.8' into 0.9 2015-05-28 11:29:15 -03:00
Henrique Moody abc712d8e9 Merge pull request #353 from henriquemoody/json
Fix wrong behaviour on JSON rule
2015-05-28 11:27:51 -03:00
Henrique Moody fa265e3edf Fix wrong behaviour on JSON rule
It was not considering values like `false`, `null`, `[]` or `{}`.
2015-05-28 11:02:07 -03:00
Henrique Moody 28ed0da084 Merge pull request #349 from Rans0n/patch-1
Update Validator.php
2015-05-15 11:38:22 -03:00
Rans0n 153ca2e4f8 Update Validator.php
Add missing parameter in domain() method signature.
2015-05-15 11:24:51 +02:00
Augusto Pascutti fc08c96971 Prevents noWithespace failing with arrays
A warning was thrown because of the preg_match call, as not every input
is a string we prevent calls from arrays going further into checking.

Issue 346
2015-05-06 00:06:26 -03:00
Augusto Pascutti 84dec918d1 Prevents noWithespace failing with arrays
A warning was thrown because of the preg_match call, as not every input
is a string we prevent calls from arrays going further into checking.

Issue 346
2015-05-06 00:06:09 -03:00
Henrique Moody d93f9f77a0 Merge pull request #347 from Respect/issue/346-withespace-warning
Prevents noWithespace from failing validating arrays
2015-05-06 00:04:26 -03:00
Augusto Pascutti 38cab9950c Prevents noWithespace failing with arrays
A warning was thrown because of the preg_match call, as not every input
is a string we prevent calls from arrays going further into checking.

Issue 346
2015-05-05 22:38:21 -03:00
Henrique Moody 9c5591f9b8 Update work in progress version in Composer's file 2015-04-24 20:07:06 -03:00
Henrique Moody 54f6a212a2 Merge pull request #344 from henriquemoody/country
Remove "Country" rule
2015-04-24 19:33:07 -03:00
Henrique Moody cf4ec32481 Remove "Country" rule 2015-04-24 19:26:49 -03:00
Henrique Moody 1b757b3852 Merge branch '0.8' 2015-04-24 19:20:09 -03:00
Henrique Moody 0e9044de81 Merge branch '0.7' into 0.8 2015-04-24 19:19:42 -03:00
Henrique Moody 9dbb9f96cf Merge pull request #342 from qrazi/0.7
Date-validation fails when system is set to non-UTC timezone
2015-04-24 19:18:13 -03:00
qrazi b4bb681fd3 The creation of a DateTime-object from the input-string keeps the given
timezone information. However, in the comparison the DateTime-object is
first output to a timestamp, which is then converted to a string with the
date()-function. But because a timestamp does not include timezone
information, date() will assume the system's timezone. So if the system
timezone set in the PHP settings is UTC, a string with another timezone,
e.g. 2015-04-24T21:11:00+02:00, will fail to be validated. The result from
the date()-function in this example is 2015-04-24T19:11:00+00:00, which is
a different string then the input.
The DateTime-class has also an option to create a string from a format,
DateTime->format(). So it is possible to skip the use of the
date()-function with the added benefit that using format() does have
access to the timezone information and thus produces the expected
2015-04-24T21:11:00+02:00 to compare with the given input.

This commit changes the Rule to accommodate this and expands the tests. If
these added tests are run before applying the fix to the Date-rule, the
tests will fail.
2015-04-24 23:03:45 +02:00
Henrique Moody 7ce7a806ee Merge branch '0.8' 2015-04-24 17:49:42 -03:00
Henrique Moody b165d6e660 Merge branch '0.7' into 0.8 2015-04-24 17:48:49 -03:00
Henrique Moody 2e755f3e01 Merge pull request #343 from henriquemoody/travis
Remove cache of "vendor/" directory
2015-04-24 17:47:42 -03:00
Henrique Moody 5568f0a96f Remove cache of "vendor/" directory
See phpspec/phpspec#595 for more information.
2015-04-24 17:38:56 -03:00
Henrique Moody 62465c6d69 Merge pull request #341 from henriquemoody/abstract_searcher
Create "AbstractSearcher" class
2015-04-24 15:07:14 -03:00
Henrique Moody d3a156f49e Create "AbstractSearcher" class
There are some other rules which could extend this class too, like Tld
and CountryCode, but was not changed in order to avoid code duplication
or API breaks.
2015-04-24 14:55:00 -03:00
Henrique Moody 01ac662c19 Merge pull request #337 from henriquemoody/country
Create "Country" rule
2015-04-23 14:27:06 -03:00
Henrique Moody d728061c45 Create "Country" rule 2015-04-23 14:12:53 -03:00
Henrique Moody ec6eb82a00 Merge branch '0.8' 2015-04-17 00:04:02 -03:00
Henrique Moody 8ca24c2f84 Merge branch '0.7' into 0.8 2015-04-17 00:03:36 -03:00
Henrique Moody f68baf7c34 Merge pull request #332 from henriquemoody/not
Fix wrong behaviour on Not rule
2015-04-17 00:01:45 -03:00
Henrique Moody b2381d3db6 Merge pull request #331 from henriquemoody/php7
Remove PHP 7 from Travis build
2015-04-16 23:52:04 -03:00
Henrique Moody 0b6c5273e4 Fix wrong behaviour on Not rule 2015-04-16 23:45:17 -03:00
Henrique Moody 34aa239513 Remove PHP 7 from Travis build
We have the "Int" rule but "int" is reserved word in PHP 7, so, until we
rename this rule - which will be just on our first major release -, we
will have no support for this version of PHP.
2015-04-16 23:41:11 -03:00
Henrique Moody 7c39c7645e Merge branch '0.8' 2015-04-16 23:32:43 -03:00
Henrique Moody 88f2ac465c Merge branch '0.7' into 0.8 2015-04-16 23:32:09 -03:00
Henrique Moody f245121444 Merge pull request #330 from henriquemoody/hhvm
Fix PHPUnit tests on HHVM
2015-04-16 23:31:24 -03:00
Henrique Moody c63d967179 Fix PHPUnit tests on HHVM 2015-04-16 20:01:15 -03:00
Henrique Moody a46c32faf3 Merge pull request #329 from TomasVotruba/patch-2
travis: --dev cleanup
2015-04-16 18:38:57 -03:00
Tomáš Votruba a1a3c03a13 travis: --dev cleanup 2015-04-16 23:30:30 +02:00
Henrique Moody 4ee11a7c19 Merge branch '0.8' 2015-04-16 14:02:47 -03:00
Henrique Moody f8fb86df45 Merge branch '0.7' into 0.8 2015-04-16 13:57:51 -03:00
Andreas Wolf 8ba31398fd Make AlwaysInvalid::assert('') fail
Resolves #326
2015-04-16 13:56:27 -03:00
Henrique Moody 546faa38d5 Merge pull request #318 from hhamon/code-simplifications
[Rules] simplified if/else conditions.
2015-03-28 10:50:42 -03:00
Hugo Hamon 03114c3681 [Rules] simplified if/else conditions. 2015-03-28 12:43:27 +01:00
Henrique Moody 0b7b24a3cf Merge branch '0.8' 2015-03-02 14:06:36 -03:00
Henrique Moody c385684249 Merge branch '0.7' into 0.8 2015-03-02 14:05:46 -03:00
Henrique Moody 8b5ca94646 Merge pull request #314 from henriquemoody/0.7
Update REGEX for postal code of "GB" country
2015-03-02 14:04:21 -03:00