class
Illuminate
/
Testing
/
Fluent
/
AssertableJson
You are viewing an older version of the documentation. For the latest, please visit master documentation.
AssertableJson
Implements
Uses
Properties
private
$props array
The properties in the current scope.
Default: null
private
$path string|null
The "dot" path to the current scope.
Default: null
Methods
protected
__construct ( array $props , string $path ) : void
Create a new fluent, assertable JSON data instance.
Parameters
- $props array
- $path string|null
protected
dotPath ( string $key ) : string
Compose the absolute "dot" path to the given key.
Parameters
- $key string
protected
prop ( string $key ) : mixed
Retrieve a prop within the current scope using "dot" notation.
Parameters
- $key string|null
protected
scope ( string $key , Closure $callback ) : $this
Instantiate a new "scope" at the path of the given key.
Parameters
- $key string
- $callback Closure
public
first ( Closure $callback ) : $this
Instantiate a new "scope" on the first child element.
Parameters
- $callback Closure
public
each ( Closure $callback ) : $this
Instantiate a new "scope" on each child element.
Parameters
- $callback Closure
public
static
fromArray ( array $data ) : static
Create a new instance from an array.
Parameters
- $data array
public
static
fromAssertableJsonString ( AssertableJsonString $json ) : static
Create a new instance from a AssertableJsonString.
Parameters
- $json AssertableJsonString
public
toArray ( ) : array
Get the instance as an array.