Adldap\Configuration\DomainConfiguration::validate PHP Method

validate() protected method

If an invalid type is given, an exception is thrown.
protected validate ( string $key, mixed $value ) : boolean
$key string
$value mixed
return boolean
    protected function validate($key, $value)
    {
        $default = $this->get($key);
        if (is_array($default)) {
            $validator = new ArrayValidator($key, $value);
        } elseif (is_int($default)) {
            $validator = new IntegerValidator($key, $value);
        } elseif (is_bool($default)) {
            $validator = new BooleanValidator($key, $value);
        } else {
            $validator = new StringValidator($key, $value);
        }
        return $validator->validate();
    }