/** * valid options: * starts_with * ends_with * contains * except * ignore_case */ public function __construct($options = array(), $messages = array()) { if (empty($options)) { throw new InvalidArgumentException('validate options is required.'); } if (is_string($options)) { $options = array('is' => $options); } $options = array_merge(array('starts_with' => null, 'ends_with' => null, 'contains' => null, 'except' => null, 'is' => null, 'ignore_case' => false), $options); parent::__construct($options, $messages); }
public function __construct($options = array(), $messages = array()) { if (isset($options['>'])) { $options['greater_than'] = $options['>']; } if (isset($options['<'])) { $options['less_than'] = $options['<']; } if (isset($options['int'])) { $options['integer'] = $options['int']; } parent::__construct($options, $messages); }