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