Go to file
Henrique Moody a039d6d4b9
Fix wrong behavior of "Date" rule
The validation was considering "99" as a valid month and neither
date_parse_from_format() [1] or DateTime::createFromFormat() [2] would
complain about that.

The solution for that was to use checkdate() [3] to verify whether the
date is valid or not. Also, an extra step was added to the validation
that a date that only contains a day would return false since a day
without a month and year is impossible to validate.

Apparently, there is no problem while validation when it comes to time,
therefore nothing needed to be added for this validation.

[1]: http://php.net/date_parse_from_format
[2]: http://php.net/datetime.createFromFormat
[3]: http://php.net/checkdate

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-08-29 21:46:53 +02:00
docs Organize documentation for "Read the Docs" 2018-08-23 01:59:39 +02:00
library Fix wrong behavior of "Date" rule 2018-08-29 21:46:53 +02:00
tests Fix wrong behavior of "Date" rule 2018-08-29 21:46:53 +02:00
.gitignore Add "composer.lock" to the .gitignore list 2015-10-17 14:10:41 -03:00
.php_cs Use short array syntax 2015-10-17 22:56:32 -03:00
.scrutinizer.yml Use PSR-2 standard 2015-01-08 00:44:12 -02:00
.travis.yml Run PHP 7.1 on Travis 2016-08-03 09:41:33 +02:00
CHANGELOG.md Organize documentation for "Read the Docs" 2018-08-23 01:59:39 +02:00
composer.json Update composer.json 2018-06-20 23:25:11 +03:00
CONTRIBUTING.md Organize documentation for "Read the Docs" 2018-08-23 01:59:39 +02:00
couscous.yml Add Google Analytics tracking ID to "couscous.yml" 2015-02-18 08:49:05 -02:00
LICENSE.md Organize documentation for "Read the Docs" 2018-08-23 01:59:39 +02:00
phpunit.xml.dist Create "SubdivisionCode" rule 2015-09-21 13:54:02 -03:00
README.md Organize documentation for "Read the Docs" 2018-08-23 01:59:39 +02:00

Respect\Validation

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version Total Downloads License

The most awesome validation engine ever created for PHP.

  • Complex rules made simple: v::numeric()->positive()->between(1, 255)->validate($input).
  • Granularity control for advanced reporting.
  • More than 100 (fully tested) validators.
  • A concrete API for non fluent usage.
  • Works on PHP 5.4+ or HHVM 3.3+

Documentation

Documentation can be found in https://respect-validation.readthedocs.io and also in the docs/ folder.

Table of contents