Exemple #1
0
 public function __construct($options)
 {
     $options = array_merge($options, array('allow_null' => true));
     if (!isset($options['accept'])) {
         $options['accept'] = '1';
     }
     parent::__construct($options);
 }
Exemple #2
0
 public function __construct($options)
 {
     $range = isset($options['in']) ? $options['in'] : (isset($options['within']) ? $options['within'] : null);
     if ($range) {
         if (!is_array($range)) {
             throw new \InvalidArgumentException('`in` and `within` must be an array');
         }
         $options['min'] = min($range);
         $options['max'] = max($range);
     }
     parent::__construct($options);
 }