Matching
trait Matching (View source)
Methods
Asserts that the property is of the expected type.
Asserts that all properties are of their expected types.
Asserts that the property contains the expected values.
Ensures that all properties are sorted the same way, recursively.
Compose the absolute "dot" path to the given key.
Retrieve a prop within the current scope using "dot" notation.
Details
Matching
where(string $key, mixed|Closure $expected)
Asserts that the property matches the expected value.
Matching
whereNot(string $key, mixed|Closure $expected)
Asserts that the property does not match the expected value.
Matching
whereAll(array $bindings)
Asserts that all properties match their expected values.
Matching
whereType(string $key, string|array $expected)
Asserts that the property is of the expected type.
Matching
whereAllType(array $bindings)
Asserts that all properties are of their expected types.
$this
whereContains(string $key, mixed $expected)
Asserts that the property contains the expected values.
protected void
ensureSorted(mixed $value)
Ensures that all properties are sorted the same way, recursively.
abstract protected string
dotPath(string $key = '')
Compose the absolute "dot" path to the given key.
abstract $this
has(string $key, null $value = null, Closure|null $scope = null)
Ensure that the given prop exists.
abstract protected mixed
prop(string|null $key = null)
Retrieve a prop within the current scope using "dot" notation.