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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
fapi_validation
Merge requests
!54
You need to sign in or sign up before continuing.
Issue
#3500209
: Use attributes for DigitValidator plugin
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#3500209
: Use attributes for DigitValidator plugin
issue/fapi_validation-3500209:3500209-use-attributes-for
into
3.0.x
Overview
0
Commits
1
Pipelines
2
Changes
1
Merged
oleksandr p.
requested to merge
issue/fapi_validation-3500209:3500209-use-attributes-for
into
3.0.x
3 months ago
Overview
0
Commits
1
Pipelines
2
Changes
1
Expand
Related to
#3500209
0
0
Merge request reports
Compare
3.0.x
3.0.x (base)
and
latest version
latest version
47f4ce0b
1 commit,
3 months ago
1 file
+
8
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/Plugin/FapiValidationValidator/DigitValidator.php
+
8
−
5
Options
@@ -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
{
/**
Loading