ArraySubset
class ArraySubset extends Constraint
Properties
| protected iterable | $subset | ||
| protected bool | $strict |
Methods
Create a new array subset constraint instance.
Evaluates the constraint for parameter $other.
Returns a string representation of the constraint.
Returns the description of the failure.
Convert an iterable to an array.
Details
at line 21
__construct(iterable $subset, bool $strict = false)
Create a new array subset constraint instance.
at line 37
bool|null
evaluate(mixed $other, string $description = '', bool $returnResult = false)
Evaluates the constraint for parameter $other.
If $returnResult is set to false (the default), an exception is thrown in case of a failure. null is returned otherwise.
If $returnResult is true, the result of the evaluation is returned as a boolean value instead: true in case of success, false in case of a failure.
at line 73
string
toString()
Returns a string representation of the constraint.
at line 84
protected string
failureDescription(mixed $other)
Returns the description of the failure.
The beginning of failure messages is "Failed asserting that" in most cases. This method should return the second part of that sentence.
at line 92
protected array
toArray(iterable $other)
Convert an iterable to an array.