Replace isValid() calls with assert()

There's more value on showing how `assert()` displays the validation
messages than simply showing if `isValid()` returns `true` or `false`.

However, that increases the chances of having outdated documentation, so
I created a doc linter that updates the Markdown files with the
correct message.
This commit is contained in:
Henrique Moody 2026-01-06 14:12:06 +01:00
commit d2198dfd01
No known key found for this signature in database
GPG key ID: 221E9281655813A6
165 changed files with 1748 additions and 623 deletions

View file

@ -6,9 +6,14 @@ Validates if the input is an array or if the input can be used as an array
(instance of `ArrayAccess` or `SimpleXMLElement`).
```php
v::arrayVal()->isValid([]); // true
v::arrayVal()->isValid(new ArrayObject); // true
v::arrayVal()->isValid(new SimpleXMLElement('<xml></xml>')); // true
v::arrayVal()->assert([]);
// Validation passes successfully
v::arrayVal()->assert(new ArrayObject);
// Validation passes successfully
v::arrayVal()->assert(new SimpleXMLElement('<xml></xml>'));
// Validation passes successfully
```
## Templates
@ -55,5 +60,4 @@ See also:
- [ScalarVal](ScalarVal.md)
- [Sorted](Sorted.md)
- [Subset](Subset.md)
- [Type](Type.md)
- [Unique](Unique.md)