public function assert($input) { if (!$this->validate($input)) { throw new ValidatorException($this->getError() ?: ''); } return true; }