class ValidationData

Properties

static protected string|null $placeholderHash

The current placeholder hash.

Methods

static string
encodeAttribute(string $attribute)

Encode escaped dots and asterisks in an attribute.

static string
decodeAttribute(string $attribute)

Decode escaped dots and asterisks in an attribute.

static string
encodeKey(int|string $key)

Encode literal dots and asterisks in a data key.

static array
encodeKeys(array $data)

Encode literal dots and asterisks in data keys.

static array
decodeKeys(array $data)

Decode literal dots and asterisks in data keys.

static string
replacePlaceholderInString(string $value)

Replace placeholders in the given string.

static array
expandWildcardKeys(string $attribute, array $data)

Expand a wildcard attribute into its matching concrete keys.

static array
initializeAndGatherData(string $attribute, array $masterData)

Initialize and gather data for the given attribute.

static array
initializeAttributeOnData(string $attribute, array $masterData)

Gather a copy of the attribute data filled with any missing attributes.

static array
extractValuesForWildcards(array $masterData, array $data, string $attribute)

Get all of the exact attribute values for a given wildcard attribute.

static array
extractDataFromPath(string|null $attribute, array $masterData)

Extract data based on the given dot-notated path.

static string|null
getLeadingExplicitAttributePath(string $attribute)

Get the explicit part of the attribute name.

static string
placeholderHash()

Get the placeholder hash.

static void
flushState()

Flush all static state.

Details

at line 20
static string encodeAttribute(string $attribute)

Encode escaped dots and asterisks in an attribute.

Parameters

string $attribute

Return Value

string

at line 34
static string decodeAttribute(string $attribute)

Decode escaped dots and asterisks in an attribute.

Parameters

string $attribute

Return Value

string

at line 48
static string encodeKey(int|string $key)

Encode literal dots and asterisks in a data key.

Parameters

int|string $key

Return Value

string

at line 62
static array encodeKeys(array $data)

Encode literal dots and asterisks in data keys.

Parameters

array $data

Return Value

array

at line 88
static array decodeKeys(array $data)

Decode literal dots and asterisks in data keys.

Parameters

array $data

Return Value

array

at line 104
static string replacePlaceholderInString(string $value)

Replace placeholders in the given string.

Parameters

string $value

Return Value

string

at line 121
static array expandWildcardKeys(string $attribute, array $data)

Expand a wildcard attribute into its matching concrete keys.

Parameters

string $attribute
array $data

Return Value

array

at line 134
static array initializeAndGatherData(string $attribute, array $masterData)

Initialize and gather data for the given attribute.

Parameters

string $attribute
array $masterData

Return Value

array

at line 148
static protected array initializeAttributeOnData(string $attribute, array $masterData)

Gather a copy of the attribute data filled with any missing attributes.

Parameters

string $attribute
array $masterData

Return Value

array

at line 164
static protected array extractValuesForWildcards(array $masterData, array $data, string $attribute)

Get all of the exact attribute values for a given wildcard attribute.

Parameters

array $masterData
array $data
string $attribute

Return Value

array

at line 192
static array extractDataFromPath(string|null $attribute, array $masterData)

Extract data based on the given dot-notated path.

Used to extract a sub-section of the data for faster iteration.

Parameters

string|null $attribute
array $masterData

Return Value

array

at line 212
static string|null getLeadingExplicitAttributePath(string $attribute)

Get the explicit part of the attribute name.

E.g. 'foo.bar.*.baz' -> 'foo.bar'

Allows us to not spin through all of the flattened data for some operations.

Parameters

string $attribute

Return Value

string|null

at line 220
static protected string placeholderHash()

Get the placeholder hash.

Return Value

string

at line 283
static void flushState()

Flush all static state.

Return Value

void