Exemplo n.º 1
0
 /**
  * Create a new AnewtValidatorFloat.
  *
  * \param $min
  *   Minimum allowable value. Provide \c null for no limit. Defaults to 0.
  *
  * \param $max
  *   Maximum allowable value. Provide \c null for no limit. Defaults to null.
  */
 function __construct($min = 0.0, $max = null)
 {
     assert('is_int($min) || is_float($min) || is_null($min)');
     assert('is_int($max) || is_float($max) || is_null($max)');
     parent::__construct();
     $this->_min = $min;
     $this->_max = $max;
 }
Exemplo n.º 2
0
 /**
  * Create an AnewtValidatorPreg instance.
  *
  * \param $pattern
  *   A regular expression to use for validating.
  */
 function __construct($pattern)
 {
     parent::__construct();
     /* Pattern must be a string */
     assert('is_string($pattern)');
     /* At least one opening and one closing delimiter */
     assert('strlen($pattern) > 2');
     /* Require delimiter characters to be the same. Note that pattern
      * modifiers can be placed after the closing delimiter. */
     assert('strpos($pattern, $pattern[0], 1) !== false');
     $this->_pattern = $pattern;
 }
Exemplo n.º 3
0
 /**
  * Create a new AnewtValidatorChoice instance.
  *
  * \param $choice_control
  *   The choice control to check.
  */
 function __construct($choice_control)
 {
     assert('$choice_control instanceof AnewtFormControlChoice;');
     parent::__construct();
     $this->_choice_control = $choice_control;
 }