public function validate($val) { if ($this->required) { if (Useful::stripper($val) === false) { $this->error[] = 'is required'; } } if (in_array($val, $this->false_values)) { $this->error[] = 'is not a valid selection'; } return !empty($this->error) ? false : true; }