Has
trait Has (View source)
Methods
Assert that none of the given props exist.
Compose the absolute "dot" path to the given key.
Marks the property as interacted.
Retrieve a prop within the current scope using "dot" notation.
Disables the interaction check.
Details
Has
count(string|int $key, int|null $length = null)
Assert that the prop is of the expected size.
Has
has(string|int $key, int|Closure|null $length = null, Closure|null $callback = null)
Ensure that the given prop exists.
Has
hasAll(array|string $key)
Assert that all of the given props exist.
Has
hasAny(array|string $key)
Assert that at least one of the given props exists.
Has
missingAll(array|string $key)
Assert that none of the given props exist.
Has
missing(string $key)
Assert that the given prop does not exist.
abstract protected string
dotPath(string $key = '')
Compose the absolute "dot" path to the given key.
abstract protected void
interactsWith(string $key)
Marks the property as interacted.
abstract protected mixed
prop(string|null $key = null)
Retrieve a prop within the current scope using "dot" notation.
abstract protected $this
scope(string $key, Closure $callback)
Instantiate a new "scope" at the path of the given key.
abstract $this
etc()
Disables the interaction check.
abstract $this
first(Closure $callback)
Instantiate a new "scope" on the first element.