Problem/Motivation
Fix the phpcs issues reported.
FILE: password_policy_history/tests/src/Unit/PasswordHistoryTest.php
------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------
131 | ERROR | [x] Missing function doc comment
134 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------
FILE: password_policy_history/password_policy_history.module
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
32 | ERROR | The $_POST super global must not be accessed directly; inject the request.stack service and use $stack->getCurrentRequest()->request->get('pass') instead
32 | ERROR | The $_POST super global must not be accessed directly; inject the request.stack service and use $stack->getCurrentRequest()->request->get('pass') instead
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: src/Plugin/migrate/process/PolicyConfiguration.php
------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------
127 | ERROR | Type hint "array" missing for $value
------------------------------------------------------------------------------------------------------
Time: 2.28 secs; Memory: 14MBSteps to reproduce
Run phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,css,info,yml .
Proposed resolution
Fix the issues reported and re-run the above command to check all issues are fixed.
Issue fork password_policy-3347789
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
hardikpandya commentedComment #4
avpadernoThat does not describe what the method does. Then, parameters are not documented, nor is the return value.
Comment #7
kunalgautam commentedComment #9
avpadernoWhat reported by PHP_CodeSniffer and shown in the issue summary does not say that method must be removed.
Comment #12
sakthi_dev commentedPlease review.
Comment #13
avpadernoParameters are not described that way. It is not a helpful description, since it repeats the parameter names, adding variable. (Yes, a parameter is a local variable accessible from the function/method. That is how PHP works.)
If a method/function does not return anything,
@returndoes not need to be added.Comment #16
diego_mow commentedMR 50 fixes same code from MR 49 + Comments on #13.
Comment #17
alina.basarabeanu commentedI applied the changes from MR 50 to Drupal Version 9.5.10 and Password Policy 4.0.0 but I still get a lot of phpcs errors.
I will list just a few.
FILE: /docroot/modules/contrib/password_policy/password_policy_delay/src/Plugin/PasswordConstraint/PasswordDelay.php
---------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------
12 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Password\PasswordInterface.
---------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------
FILE: /docroot/modules/contrib/password_policy/PATCHES.txt
-----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------
1 | WARNING | [ ] Line exceeds 80 characters; contains 104 characters
5 | ERROR | [x] Expected 1 newline at end of file; 3 found
-----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------
FILE: /docroot/modules/contrib/password_policy/password_policy.module
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------
10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\EntityInterface.
---------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
FILE: /docroot/modules/contrib/password_policy/password_policy_history/tests/src/Unit/PasswordHistoryTest.php
---------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
---------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Password\PasswordInterface.
22 | ERROR | [x] Data types in @var tags need to be fully namespaced
129 | ERROR | [x] Expected 1 blank line after function; 0 found
130 | ERROR | [ ] Parameter $value is not described in comment
137 | ERROR | [x] Doc comment parameter name "$value." must not end with a dot
---------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------
Comment #18
nisha_j commentedComment #20
anjali mehta commentedKindly review the changes.
Thank you.
Comment #21
anjali mehta commentedComment #22
kristen polAssigning to myself for review.
Comment #23
kristen polDuplicate issue found. I'll need to close one of these.
#3367028: Fix the issues reported by phpcs
Comment #27
kristen polMerge conflict needs fixing.
Comment #31
kristen polCopying issue credits for people who worked on duplicate issue:
#3367028: Fix the issues reported by phpcs
Comment #32
vishalkhode commentedClosing as this is fixed in #3464639: Fix Validate pipeline.