public function addValidator(\Jyxo\Input\ValidatorInterface $validator, string $errorMessage = null) { $this->chain[] = [self::VALIDATOR, $validator, $errorMessage]; return $this; }
/** * Adds a validator to the chain. * * @param string $name Validator name * @param string $errorMessage Validator error message * @param mixed $param Additional validator parameter * @return \Jyxo\Input\Fluent */ public function validate(string $name, string $errorMessage = null, $param = null) : self { $this->chain->addValidator($this->factory->getValidatorByName($name, $param), $errorMessage); return $this; }