Closed WilliamDEdwards closed 2 years ago
At the moment, there's no built-in way to validate each item in a list. I've added todos for lists for which each item should be validated as a path.
I've added the ->each()
option to the validation. Just provide multiple values to the validator and call ->each()
.
In this example, it will ensure both test.js
and app.js
end with .js
:
$result = Validator::value(['test.js', 'app.js'])
->each()
->endsWith('.js')
->validate();
See tests/Support/ValidatorTest.php
for more examples.
I've added the
->each()
option to the validation. Just provide multiple values to the validator and call->each()
.In this example, it will ensure both
test.js
andapp.js
end with.js
:$result = Validator::value(['test.js', 'app.js']) ->each() ->endsWith('.js') ->validate();
See
tests/Support/ValidatorTest.php
for more examples.
I've solved the todos by using the new ->each()
option.
Changes
Branched off https://github.com/CyberfusionNL/cyberfusion-cluster-api-client/pull/3
Checks
Client.php