PHP Trait LdapTools\ConfigurationParseTrait

Author: Chad Sikorra ([email protected])
Show file Open project: ldaptools/ldaptools

Protected Methods

Method Description
getParsedConfig ( array $config, array $existingConfig, array $configMap, array $required ) : array Parses a YAML config section and sends it back as the correct config values as an array.
isParsedConfigValid ( array $config, array $required ) : boolean Checks whether all required values for the configuration have been set after the merge.
setParsedConfig ( array $config ) Given a config that has been parsed to what the config values should be, call the setters to make sure all values are validated by any additional logic in the setters.

Method Details

getParsedConfig() protected method

Parses a YAML config section and sends it back as the correct config values as an array.
protected getParsedConfig ( array $config, array $existingConfig, array $configMap, array $required ) : array
$config array The YAML config section as an array.
$existingConfig array The config before merging the YAML config.
$configMap array The YAML to config key map array.
$required array The required options that must be in the array.
return array The YAML config merged with the existing config.

isParsedConfigValid() protected method

Checks whether all required values for the configuration have been set after the merge.
protected isParsedConfigValid ( array $config, array $required ) : boolean
$config array
$required array
return boolean

setParsedConfig() protected method

Given a config that has been parsed to what the config values should be, call the setters to make sure all values are validated by any additional logic in the setters.
protected setParsedConfig ( array $config )
$config array