class SchemaGenerator (View source)

Configuration schema generator.

The implementation is still simple and intends to be a kickstart for writing schemas. In future this can be extended.

See \Neos\Utility\SchemaValidator for a description of all features of the SchemaValidator

Methods

array
generate(mixed $value)

Generate a schema for the given value

array
generateDictionarySchema(array $dictionaryValue)

Create a schema for a dictionary

array
generateArraySchema(array $arrayValue)

Create a schema for an array structure

array
generateStringSchema(string $stringValue)

Create a schema for a given string

mixed
filterDuplicatesFromArray(array $values)

Compact an array of items to avoid adding the same value more than once.

Details

array generate(mixed $value)

Generate a schema for the given value

Parameters

mixed $value

value to create a schema for

Return Value

array

schema as array structure

protected array generateDictionarySchema(array $dictionaryValue)

Create a schema for a dictionary

Parameters

array $dictionaryValue

Return Value

array

protected array generateArraySchema(array $arrayValue)

Create a schema for an array structure

Parameters

array $arrayValue

Return Value

array schema

protected array generateStringSchema(string $stringValue)

Create a schema for a given string

Parameters

string $stringValue

Return Value

array

protected mixed filterDuplicatesFromArray(array $values)

Compact an array of items to avoid adding the same value more than once.

If the result contains only one item, that item is returned directly.

Parameters

array $values

array of values

Return Value

mixed