sspmod_consent_Auth_Process_Consent::__construct PHP Method

__construct() public method

Validates and parses the configuration.
public __construct ( array $config, mixed $reserved )
$config array Configuration information.
$reserved mixed For future use.
    public function __construct($config, $reserved)
    {
        assert('is_array($config)');
        parent::__construct($config, $reserved);
        if (array_key_exists('includeValues', $config)) {
            if (!is_bool($config['includeValues'])) {
                throw new SimpleSAML_Error_Exception('Consent: includeValues must be boolean. ' . var_export($config['includeValues'], true) . ' given.');
            }
            $this->_includeValues = $config['includeValues'];
        }
        if (array_key_exists('checked', $config)) {
            if (!is_bool($config['checked'])) {
                throw new SimpleSAML_Error_Exception('Consent: checked must be boolean. ' . var_export($config['checked'], true) . ' given.');
            }
            $this->_checked = $config['checked'];
        }
        if (array_key_exists('focus', $config)) {
            if (!in_array($config['focus'], array('yes', 'no'), true)) {
                throw new SimpleSAML_Error_Exception('Consent: focus must be a string with values `yes` or `no`. ' . var_export($config['focus'], true) . ' given.');
            }
            $this->_focus = $config['focus'];
        }
        if (array_key_exists('hiddenAttributes', $config)) {
            if (!is_array($config['hiddenAttributes'])) {
                throw new SimpleSAML_Error_Exception('Consent: hiddenAttributes must be an array. ' . var_export($config['hiddenAttributes'], true) . ' given.');
            }
            $this->_hiddenAttributes = $config['hiddenAttributes'];
        }
        if (array_key_exists('noconsentattributes', $config)) {
            if (!is_array($config['noconsentattributes'])) {
                throw new SimpleSAML_Error_Exception('Consent: noconsentattributes must be an array. ' . var_export($config['noconsentattributes'], true) . ' given.');
            }
            $this->_noconsentattributes = $config['noconsentattributes'];
        }
        if (array_key_exists('store', $config)) {
            try {
                $this->_store = sspmod_consent_Store::parseStoreConfig($config['store']);
            } catch (Exception $e) {
                SimpleSAML\Logger::error('Consent: Could not create consent storage: ' . $e->getMessage());
            }
        }
        if (array_key_exists('showNoConsentAboutService', $config)) {
            if (!is_bool($config['showNoConsentAboutService'])) {
                throw new SimpleSAML_Error_Exception('Consent: showNoConsentAboutService must be a boolean.');
            }
            $this->_showNoConsentAboutService = $config['showNoConsentAboutService'];
        }
    }