public function isValid($value) : bool
{
$success = $this->run($value);
// $value passed by reference
$this->value = $value;
return $success;
}
/** * 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; }