Go to file
Henrique Moody a647a4737b
Split "Key" rules
Currently, the Key rule has a third parameter that allows the validation
of the wrapped rule to be optional, meaning that the validation will
only happen if the key exists. That parameter makes the rule harder to
understand at times.

I'm splitting the Key rule into Key, KeyExists, and KeyOptional. That
way, it becomes apparent when someone wants only to validate whether a
key exists or if they're going to validate the value of the key only
when it exists.

I deliberately didn't create an abstract class because those rules are
different enough not to have an abstraction. In fact, I can see myself
deleting the  "AbstractRelated" in the upcoming changes.

With these changes, the KeySet rule will not accept validating if the
key exists or validating the value only if the key exists. I should
refactor that soon, and I will likely need to create a common interface
for Key, KeyExists, and KeyOptional.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2024-03-04 00:06:18 +01:00
.github Bump actions/checkout from 3 to 4 2024-02-23 01:15:04 +01:00
bin Use PHP ISO Codes in the "LanguageCode" rule 2024-02-22 19:27:49 +01:00
data/domain/public-suffix Remove ISO 3166-2 data in favor of PHP ISO codes 2024-02-13 21:53:46 +01:00
docs Split "Key" rules 2024-03-04 00:06:18 +01:00
library Split "Key" rules 2024-03-04 00:06:18 +01:00
tests Split "Key" rules 2024-03-04 00:06:18 +01:00
.docheader Use SPDX IDs for licensing 2023-02-19 00:19:10 -03:00
.gitattributes Update list of files to be exported by Git 2020-07-29 10:35:36 +02:00
.gitignore Upgrade "phpunit/phpunit" 2024-01-28 14:16:52 +01:00
.readthedocs.yaml Create Read the Docs configuration file 2024-01-28 21:50:01 +01:00
CHANGELOG.md Check if property is initialized before getting its value 2024-01-27 20:36:01 +01:00
composer.json Update psr/http-message requirement from ^1.0 to ^1.0 || ^2.0 2024-02-23 02:01:53 +01:00
CONTRIBUTING.md Move Template to the Message namespace 2024-02-09 19:50:25 +01:00
LICENSE Dusting off. See CHANGELOG.md for more details on this commit 2023-02-13 03:59:11 -03:00
mkdocs.yml Create MkDocs configuration file 2018-12-11 09:25:41 +01:00
phpcs.xml.dist Update coding standards 2024-01-28 00:22:41 +01:00
phpstan.neon.dist Move mixin classes to the "Mixin" namespace 2024-03-03 16:52:29 +01:00
phpunit.xml.dist Upgrade "phpunit/phpunit" 2024-01-28 14:16:52 +01:00
README.md Fix broken documentation links 2024-02-19 11:34:26 +01:00

Respect\Validation

Build Status Code Coverage Latest Stable Version Total Downloads License

The most awesome validation engine ever created for PHP.

Learn More: