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

    if (empty(parent::getArgValue('extensionList'))) {
      return true;
    }
    $currentExt = ListTools::last($value['name'], '.');
    if ($currentExt && !ListTools::containsNoCase(parent::getArgValue('extensionList'), $currentExt)) {
      $eMsg = Translation::get('validatorerror_extensionList');
      $eMsg = str_replace('%extensionList%', parent::getArgValue('extensionList'), $eMsg);
      parent::addError($eMsg);
      return false;
    }

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

    if (empty(parent::getArgValue('extensionList'))) {
      return true;
    }
    $currentExt = ListTools::last($value['name'], '.');
    if ($currentExt && !ListTools::containsNoCase(parent::getArgValue('extensionList'), $currentExt)) {
      $eMsg = Translation::get('validatorerror_extensionList');
      $eMsg = str_replace('%extensionList%', parent::getArgValue('extensionList'), $eMsg);
      parent::addError($eMsg);
      return false;
    }

    return true;
  }
Teste la validité

@param mixed $value Valeur à tester
@return boolean