Example #1
0
 /**
  * Does Not constructor.
  * @param array|Assert[]|Assert $asserts Assert(s) to not comply with. (Reverse).
  */
 public function __construct($asserts)
 {
     if (!is_array($asserts)) {
         $asserts = array($asserts);
     }
     parent::__construct($asserts);
 }
Example #2
0
 /**
  * Custom validator with callback.
  *
  * @param callable $callback Callback gets to parameters, first is value, second is options from validator class.
  */
 public function __construct(callable $callback)
 {
     parent::__construct();
     $this->callback = $callback;
 }
Example #3
0
 /**
  * Contain constructor.
  *
  * @param array $conditions List of possible values.
  * @param bool $strict Strict mode, also check type? Default false.
  */
 public function __construct($conditions, $strict = false)
 {
     parent::__construct($conditions, array('strict' => $strict));
 }
Example #4
0
 /**
  * Url Assert.
  */
 public function __construct()
 {
     parent::__construct();
 }
Example #5
0
 /**
  * Regex constructor.
  * @param string $regex Your regex. ready for preg_match.
  */
 public function __construct($regex)
 {
     parent::__construct();
     $this->regex = $regex;
 }
Example #6
0
 /**
  * Validate Date, optional with format.
  * @param string $format Format to match, NULL for only verify if the date could be parsable with `strtotime()`.
  */
 public function __construct($format = null)
 {
     parent::__construct();
     $this->format = $format;
 }
Example #7
0
 /**
  * Contain constructor.
  *
  * @param array|string $conditions Contains the following items. Could be a single string too.
  * @param bool $matchCase Match case? Default false.
  */
 public function __construct($conditions, $matchCase = false)
 {
     parent::__construct($conditions, array('case' => $matchCase));
 }