protected function setConfigs($configs) { parent::setConfigs($configs); if (!isset($this->configs['min']) && !isset($this->configs['max'])) { throw new \Exception("{$this->name} rule expect 'min' or 'max' option."); } }
/** * Set arguments for checking * * @param array $arguments * * @return AbstractRule * @throws \Magelight\Exception */ public function setArguments($arguments = []) { $dateRule = DateTime::forge(); if (!isset($arguments[0]) || !isset($arguments[1])) { throw new \Magelight\Exception('Arguments for DatRange rule must be passed.'); } if (!$dateRule->check($arguments[0]) || !$dateRule->check($arguments[1])) { throw new \Magelight\Exception('Arguments for DatRange rule must be valid date strings.'); } return parent::setArguments($arguments); }
public function __construct() { parent::__construct(); trigger_error("Use xdigits instead.", E_USER_DEPRECATED); }
function HasElementsRule($arrElms) { parent::AbstractRule(); $this->elements = $arrElms; }
public function reportError($input, array $extraParams = array()) { return parent::reportError($input, $extraParams); }
/** * Returns true if the rule is valid for the given context * * @param mixed $context * * @return bool */ public function isValid($context) { return $this->rule->run($context); }