src/ConfigAwareTrait.php
protected function setConfig(Config $config, ConfigSchema $schema = null)
    {
        if ($schema) {
            $schema->validate($config);
        }

        $config->validate();

        $this->config = $config;
    }
protected function setConfig(Config $config, ConfigSchema $schema = null)
    {
        if ($schema) {
            $schema->validate($config);
        }

        $config->validate();

        $this->config = $config;
    }
protected function setConfig ( Config $ config , ConfigSchema $ schema = null ) { if ( $ schema ) { $ schema -> validate ( $ config ) ; } $ config -> validate ( ) ; $ this -> config = $ config ; }
Validates and sets the configuration object.

@since 1.0.0

@param Config            $config Configuration object.
@param ConfigSchema|null $schema Optional. Extra configuration schema to validate the configuration object
against. Default null.

@throws ConfigValidationException Thrown when validation fails.
Validates and sets the configuration object .