blob: 23b48469c01a8b482c44e4b0ec6c9c1fcbc8a15a [file] [log] [blame]
<?php
namespace Adldap\Configuration\Validators;
use Adldap\Configuration\ConfigurationException;
/**
* Class BooleanValidator.
*
* Validates that the configuration value is a boolean.
*/
class BooleanValidator extends Validator
{
/**
* {@inheritdoc}
*/
public function validate()
{
if (!is_bool($this->value)) {
throw new ConfigurationException("Option {$this->key} must be a boolean.");
}
return true;
}
}