src/Form/Validators/Operator.php
public function isValid($value)
  {
    parent::resetErrors();

    $vValue    = $this->getArgValue('value');
    $vOperator = $this->getArgValue('operator');
    $eMsg = '';

    if (!empty($value)) {
      if ($vOperator == '==' && !($value == $vValue)) {
        $error = true;
        $eMsg = Translation::get('validatorerror_operator_equal');
        $eMsg = str_replace('%value%', $vValue, $eMsg);
      } elseif ($vOperator == '!=' && !($value != $vValue)) {
        $error = true;
        $eMsg = Translation::get('validatorerror_operator_notequal');
        $eMsg = str_replace('%value%', $vValue, $eMsg);
      } elseif ($vOperator == '<' && !($value < $vValue)) {
        $error = true;
        $eMsg = Translation::get('validatorerror_operator_inferior');
        $eMsg = str_replace('%value%', $vValue, $eMsg);
      } elseif ($vOperator == '<=' && !($value <= $vValue)) {
        $error = true;
        $eMsg = Translation::get('validatorerror_operator_inferiororequal');
        $eMsg = str_replace('%value%', $vValue, $eMsg);
      } elseif ($vOperator == '>' && !($value > $vValue)) {
        $error = true;
        $eMsg = Translation::get('validatorerror_operator_superior');
        $eMsg = str_replace('%value%', $vValue, $eMsg);
      } elseif ($vOperator == '>=' && !($value >= $vValue)) {
        $error = true;
        $eMsg = Translation::get('validatorerror_operator_superiororequal');
        $eMsg = str_replace('%value%', $vValue, $eMsg);
      }

      if ($error) {
        parent::addError($eMsg);
        return false;
      }
    }

    return true;
  }
public function isValid($value)
  {
    parent::resetErrors();

    $vValue    = $this->getArgValue('value');
    $vOperator = $this->getArgValue('operator');
    $eMsg = '';

    if (!empty($value)) {
      if ($vOperator == '==' && !($value == $vValue)) {
        $error = true;
        $eMsg = Translation::get('validatorerror_operator_equal');
        $eMsg = str_replace('%value%', $vValue, $eMsg);
      } elseif ($vOperator == '!=' && !($value != $vValue)) {
        $error = true;
        $eMsg = Translation::get('validatorerror_operator_notequal');
        $eMsg = str_replace('%value%', $vValue, $eMsg);
      } elseif ($vOperator == '<' && !($value < $vValue)) {
        $error = true;
        $eMsg = Translation::get('validatorerror_operator_inferior');
        $eMsg = str_replace('%value%', $vValue, $eMsg);
      } elseif ($vOperator == '<=' && !($value <= $vValue)) {
        $error = true;
        $eMsg = Translation::get('validatorerror_operator_inferiororequal');
        $eMsg = str_replace('%value%', $vValue, $eMsg);
      } elseif ($vOperator == '>' && !($value > $vValue)) {
        $error = true;
        $eMsg = Translation::get('validatorerror_operator_superior');
        $eMsg = str_replace('%value%', $vValue, $eMsg);
      } elseif ($vOperator == '>=' && !($value >= $vValue)) {
        $error = true;
        $eMsg = Translation::get('validatorerror_operator_superiororequal');
        $eMsg = str_replace('%value%', $vValue, $eMsg);
      }

      if ($error) {
        parent::addError($eMsg);
        return false;
      }
    }

    return true;
  }
Teste la validité

@param  mixed $value Valeur à tester
@return boolean