Gregwar\Formidable\Fields\Field::addConstraint PHP Method

addConstraint() public method

public addConstraint ( $closure )
    public function addConstraint($closure)
    {
        if (!$closure instanceof \Closure) {
            throw new \InvalidArgumentException('addConstraint() argument should be a \\Closure');
        }
        $this->constraints[] = $closure;
    }