Problem/Motivation
Getting Following errors/warnings
$ phpcs --standard=Drupal username_validation
FILE: ...min\Desktop\task\username_validation\src\Form\UserNameValidationConfig.php
--------------------------------------------------------------------------------
FOUND 7 ERRORS AND 1 WARNING AFFECTING 8 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found
| | "\r\n"
12 | WARNING | [ ] The class short comment should describe what the class
| | does and not simply repeat the class name
73 | ERROR | [x] Use null coalesce operator instead of ternary operator.
83 | ERROR | [x] Use null coalesce operator instead of ternary operator.
90 | ERROR | [x] Use null coalesce operator instead of ternary operator.
97 | ERROR | [x] Use null coalesce operator instead of ternary operator.
106 | ERROR | [x] Use null coalesce operator instead of ternary operator.
115 | ERROR | [x] Use null coalesce operator instead of ternary operator.
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Time: 458ms; Memory: 8MB
Proposed resolution
Fix the errors and warnings.
Issue fork username_validation-3337901
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
jay jangid commentedCreated MR , please review.
Thank you.
Comment #4
realsp commentedFound following phpcs issues in MR #2,
Comment #5
realsp commentedI'll update the MR to fix the remaining phpcs issues
Comment #6
realsp commentedI've fixed the remaining phpcs issues in the MR, Please review the MR.
Thank you.
Comment #8
vladimirausFew issues to fix.
See pipeline: https://git.drupalcode.org/project/username_validation/-/pipelines/149161
Comment #10
grevil commentedComment #11
grevil commentedAlright, this issue can be reviewed. There are a few dangerous, but necessary changes here, we need to manually test them first, before merging.
The eslint issue needs to be fixed in a separate issue, they are related to the empty config file (which shouldn't be empty of course), but not related to this issue. I will quickly fix the remaining cspell issues tomorrow and do some quick manually tests for the form_state "getValues()" changes and then we can commit this. Codewise, this can already get reviewed!
I'd say this will be the last commit for 1.x any further work for refactoring, etc. should be done in 2.x. (Note that we also need to cherry-pick this into 2.x once finished).
Comment #12
grevil commentedAlright, all fixed and working as expected, please review!
Comment #13
anybodyLGTM, thx!
Comment #14
anybodyComment #15
grevil commentedThanks all, fixed!
Comment #17
grevil commentedComment #19
vladimiraus