Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fapi_validation
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
fapi_validation
Commits
2024cc0e
Commit
2024cc0e
authored
8 months ago
by
igor mashevskyi
Browse files
Options
Downloads
Plain Diff
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
8 months ago
Stage: build
Stage: validate
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Plugin/FapiValidationValidator/LengthValidator.php
+8
-5
8 additions, 5 deletions
src/Plugin/FapiValidationValidator/LengthValidator.php
with
8 additions
and
5 deletions
src/Plugin/FapiValidationValidator/LengthValidator.php
+
8
−
5
View file @
2024cc0e
...
...
@@ -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
{
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment