Skip to content
Snippets Groups Projects
Commit 32a9f76e authored by Oleksandr Pozharskyi's avatar Oleksandr Pozharskyi Committed by Viktor Holovachek
Browse files

Issue #3500209: Use attributes for DigitValidator plugin

parent 81ff24ea
No related branches found
No related tags found
1 merge request!54Issue #3500209: Use attributes for DigitValidator plugin
Pipeline #405638 canceled
......@@ -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 Digit validation.
*
* @FapiValidationValidator(
* id = "digit",
* error_message = "Use only digits on %field."
* )
*/
#[FapiValidationValidator(
id: 'digit',
label: new TranslatableMarkup('Alpha Numeric'),
description: new TranslatableMarkup('Transform input value to digit.'),
error_message: 'Use only digits on %field.',
)]
class DigitValidator 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