public function __set($name, $value) { if (!array_key_exists($name, $this->constraints)) { throw new PropertyNotFound("The constraint '{$name}' is not valid for this validator."); } $this->constraints[$name] = $value; }