N°6414 Validator refactoring

New AbstractValidator class, with new method Validate
All existing validators are now children of AbstractRegexpValidator
Handle validators JS counterparts in renderers : only regexp validators are implemented client side
This commit is contained in:
Pierre Goiffon
2023-06-29 10:41:51 +02:00
parent 52049b7837
commit 6606af71ff
26 changed files with 348 additions and 247 deletions

View File

@@ -0,0 +1,22 @@
<?php
/*
* @copyright Copyright (C) 2010-2023 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Form\Validator;
/**
* @since 3.1.0 N°6414
*/
class CustomRegexpValidator extends AbstractRegexpValidator
{
public const VALIDATOR_NAME = 'custom_regexp';
public function __construct(string $sRegExp, ?string $sErrorMessage = null)
{
parent::__construct($sErrorMessage);
$this->sRegExp = $sRegExp; // must be done after parent constructor call !
}
}