Skip to content
Snippets Groups Projects
Commit 269540cd authored by Oleksandr Pozharskyi's avatar Oleksandr Pozharskyi
Browse files

Issue #3500205: Use attributes for AlphaNumericValidator plugin

parent d70e9495
No related branches found
No related tags found
1 merge request!50Issue #3500205: Use attributes for AlphaNumericValidator plugin
Pipeline #405597 passed with warnings
......@@ -3,17 +3,20 @@
namespace Drupal\fapi_validation\Plugin\FapiValidationValidator;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\fapi_validation\Attribute\FapiValidationValidator;
use Drupal\fapi_validation\FapiValidationValidatorsInterface;
use Drupal\fapi_validation\Validator;
/**
* Fapi Validation Plugin for Alpha Numeric validation.
*
* @FapiValidationValidator(
* id = "alpha_numeric",
* error_message = "Use only alpha numerics characters at %field."
* )
*/
#[FapiValidationValidator(
id: 'alpha_numeric',
label: new TranslatableMarkup('Alpha Numeric'),
description: new TranslatableMarkup('Transform input value to alpha numerics.'),
error_message: 'Use only alpha numerics characters at %field.',
)]
class AlphaNumericValidator implements FapiValidationValidatorsInterface {
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment