public function __construct(array $options = []) { parent::__construct($options); $options = $this->getOptions(); if (!is_bool($options['trim'])) { throw new \Gajus\Vlad\Exception\InvalidArgumentException('Boolean property assigned non-boolean value.'); } }
public function __construct(array $options = []) { parent::__construct($options); $options = $this->getOptions(); if (!isset($options['format'])) { throw new \Gajus\Vlad\Exception\InvalidArgumentException('"format" property is required.'); } }
public function __construct(array $options = []) { parent::__construct($options); $options = $this->getOptions(); if (!isset($options['length'])) { throw new \Gajus\Vlad\Exception\InvalidArgumentException('"length" option is required.'); } if (!ctype_digit((string) $options['length'])) { throw new \Gajus\Vlad\Exception\InvalidArgumentException('"length" option must be a whole number.'); } }
public function __construct(array $options = []) { parent::__construct($options); $options = $this->getOptions(); if (!isset($options['range'])) { throw new \Gajus\Vlad\Exception\InvalidArgumentException('"range" option is required.'); } if (!is_numeric($options['range'])) { throw new \Gajus\Vlad\Exception\InvalidArgumentException('Minimum boundary option must be numeric.'); } }
public function __construct(array $options = []) { parent::__construct($options); $options = $this->getOptions(); if (!isset($options['pattern'])) { throw new \Gajus\Vlad\Exception\InvalidArgumentException('"pattern" property is required.'); } if (@preg_match($options['pattern'], 'test') === false) { throw new \Gajus\Vlad\Exception\InvalidArgumentException('Pattern "' . $options['pattern'] . '" failed (' . array_flip(get_defined_constants(true)['pcre'])[preg_last_error()] . ').'); } }
public function __construct(array $options = []) { parent::__construct($options); $options = $this->getOptions(); if (!isset($options['haystack'])) { throw new \Gajus\Vlad\Exception\InvalidArgumentException('"haystack" option is missing.'); } else { if (!is_array($options['haystack'])) { throw new \Gajus\Vlad\Exception\InvalidArgumentException('"haystack" option must be an array.'); } } if (!is_bool($options['strict']) || !is_bool($options['c14n'])) { throw new \Gajus\Vlad\Exception\InvalidArgumentException('Boolean property assigned non-boolean value.'); } }