Jyxo\Input\Chain::isValid PHP Method

isValid() public method

Returns if the value is valid.
public isValid ( mixed $value ) : boolean
$value mixed Input value
return boolean
    public function isValid($value) : bool
    {
        $success = $this->run($value);
        // $value passed by reference
        $this->value = $value;
        return $success;
    }

Usage Example

Beispiel #1
0
 /**
  * Validates a value.
  *
  * @param mixed $value Input value
  * @return boolean
  */
 public function isValid($value)
 {
     // Validation is performed only if the condition is fulfilled
     if (true === $this->checkCondition($value)) {
         return parent::isValid($value);
     }
     // No validation -> the value is valid
     $this->value = $value;
     return true;
 }
All Usage Examples Of Jyxo\Input\Chain::isValid