class ValidationPath implements Stringable

Methods

__construct(array $path = [])

Create a validation path.

static ValidationPath
create(string|null $path = null)

Create a validation path from dot notation.

property(string|int $property)

Append a property or collection segment.

item(string|int $key)

Append one raw collection key.

wildcard()

Append a collection wildcard.

bool
isRoot()

Determine if this is the root path.

bool
equals(string|ValidationPath $other)

Determine if this path equals another path.

array
segments()

Get the path segments.

array
rawSegments()

Get structural segments with wildcards represented by null.

string
get()

Get the path in dot notation.

string
__toString()

Get the string form of the path.

bool
containsWildcards()

Determine if this path contains a wildcard.

array
matchingWildcardPayloadValidationPaths(array $fullPayload)

Get the concrete paths matching this wildcard path.

array
expandWildcardPath(array $remainingSegments, mixed $payload, array $resolvedSegments = [])

Recursively expand wildcard segments against a payload.

static array
parseDotPath(string $path)

Parse Validator dot notation into structural segments.

Details

at line 16
__construct(array $path = [])

Create a validation path.

Parameters

array $path

at line 24
static ValidationPath create(string|null $path = null)

Create a validation path from dot notation.

Parameters

string|null $path

Return Value

ValidationPath

at line 36
ValidationPath property(string|int $property)

Append a property or collection segment.

Parameters

string|int $property

Return Value

ValidationPath

at line 51
ValidationPath item(string|int $key)

Append one raw collection key.

Parameters

string|int $key

Return Value

ValidationPath

at line 63
ValidationPath wildcard()

Append a collection wildcard.

Return Value

ValidationPath

at line 75
bool isRoot()

Determine if this is the root path.

Return Value

bool

at line 83
bool equals(string|ValidationPath $other)

Determine if this path equals another path.

Parameters

string|ValidationPath $other

Return Value

bool

at line 97
array segments()

Get the path segments.

Return Value

array

at line 110
array rawSegments()

Get structural segments with wildcards represented by null.

Return Value

array

at line 118
string get()

Get the path in dot notation.

Return Value

string

at line 133
string __toString()

Get the string form of the path.

Return Value

string

at line 141
bool containsWildcards()

Determine if this path contains a wildcard.

Return Value

bool

at line 151
array matchingWildcardPayloadValidationPaths(array $fullPayload)

Get the concrete paths matching this wildcard path.

Parameters

array $fullPayload

Return Value

array

at line 163
protected array expandWildcardPath(array $remainingSegments, mixed $payload, array $resolvedSegments = [])

Recursively expand wildcard segments against a payload.

Parameters

array $remainingSegments
mixed $payload
array $resolvedSegments

Return Value

array

at line 206
static protected array parseDotPath(string $path)

Parse Validator dot notation into structural segments.

Parameters

string $path

Return Value

array