PAGI\Node\Node::validateInputWith PHP Method

validateInputWith() public method

Add an input validation to this node.
public validateInputWith ( string $name, Closure $validation, string | null $soundOnError = null ) : Node
$name string A distrinctive name for this validator
$validation Closure Callback to use for validation
$soundOnError string | null Optional sound to play on error
return Node
    public function validateInputWith($name, \Closure $validation, $soundOnError = null)
    {
        $this->inputValidations[$name] = self::createValidatorInfo($validation, $soundOnError);
        return $this;
    }