Skip to content
Snippets Groups Projects
Commit 2024cc0e authored by igor mashevskyi's avatar igor mashevskyi
Browse files

Merge branch '3500212-use-attributes-for' into '3.0.x'

Issue #3500212: Use attributes for LengthValidator plugin

See merge request !45
parents 7891e83e b741c4ec
No related branches found
No related tags found
No related merge requests found
Pipeline #405497 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 Length validation.
*
* @FapiValidationValidator(
* id = "length",
* error_message = "Invalid size of %field value."
* )
*/
#[FapiValidationValidator(
id: 'length',
label: new TranslatableMarkup('Length'),
description: new TranslatableMarkup('Validate input value length.'),
error_message: 'Invalid size of %field value.',
)]
class LengthValidator implements FapiValidationValidatorsInterface {
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment