2018-06-23 16:24:48 +02:00
|
|
|
# Equivalent
|
|
|
|
|
|
|
|
- `Equivalent(mixed $compareTo)`
|
|
|
|
|
|
|
|
Validates if the input is equivalent to some value.
|
|
|
|
|
|
|
|
```php
|
|
|
|
v::equivalent(1)->validate(true); // true
|
|
|
|
v::equivalent('Something')->validate('someThing'); // true
|
|
|
|
v::equivalent(new ArrayObject([1, 2, 3, 4, 5]))->validate(new ArrayObject([1, 2, 3, 4, 5])); // true
|
|
|
|
```
|
|
|
|
|
|
|
|
This rule is very similar to [Equals](Equals.md) but it does not make case-sensitive
|
|
|
|
comparisons.
|
|
|
|
|
|
|
|
Message template for this validator includes `{{compareTo}}`.
|
|
|
|
|
2019-05-11 18:32:13 +02:00
|
|
|
## Categorization
|
|
|
|
|
|
|
|
- Comparisons
|
|
|
|
|
2018-06-23 16:24:48 +02:00
|
|
|
## Changelog
|
|
|
|
|
|
|
|
Version | Description
|
|
|
|
--------|-------------
|
|
|
|
2.0.0 | Created
|
|
|
|
|
|
|
|
***
|
|
|
|
See also:
|
|
|
|
|
|
|
|
- [Contains](Contains.md)
|
2018-12-12 15:12:45 +01:00
|
|
|
- [ContainsAny](ContainsAny.md)
|
2018-06-23 16:24:48 +02:00
|
|
|
- [Equals](Equals.md)
|
|
|
|
- [Identical](Identical.md)
|