ConfigSchemaChecker
class ConfigSchemaChecker implements EventSubscriberInterface (View source)
Listens to the config save event and validates schema.
If tests have the $strictConfigSchema property set to TRUE this event listener will be added to the container and throw exceptions if configuration is invalid.
Traits
Provides a trait for checking configuration schema.
Properties
| protected Element | $schema | The config schema wrapper object for the configuration object under test. |
from SchemaCheckTrait |
| protected string | $configName | The configuration object name under test. |
from SchemaCheckTrait |
| protected TypedConfigManagerInterface | $typedManager | The typed config manger. |
|
| protected array | $checked | An array of config checked already. Keyed by config name and a checksum. |
|
| protected string[] | $exclude | An array of config object names that are excluded from schema checking. |
Methods
Checks the TypedConfigManager has a valid schema for the configuration.
Constructs the ConfigSchemaChecker object.
Checks that configuration complies with its schema on config save.
{@inheritdoc}
Details
array|bool
checkConfigSchema(TypedConfigManagerInterface $typed_config, string $config_name, array $config_data)
Checks the TypedConfigManager has a valid schema for the configuration.
protected array
checkValue(string $key, mixed $value)
Helper method to check data type.
__construct(TypedConfigManagerInterface $typed_manager, array $exclude = [])
Constructs the ConfigSchemaChecker object.
onConfigSave(ConfigCrudEvent $event)
Checks that configuration complies with its schema on config save.
static
getSubscribedEvents()
{@inheritdoc}