Code sniffer gives a bunch of errors & warnings:
~/S/n/w/m/c/flood_unblock ❯❯❯ fin phpcs cs ./ ✘ 1
FILE: /var/www/web/modules/contrib/flood_unblock/flood_unblock.module
----------------------------------------------------------------------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
20 | WARNING | [ ] Only string literals should be passed to t() where possible
35 | ERROR | [x] Expected 1 space after "="; 2 found
57 | WARNING | [x] A comma should follow the last multiline array item. Found: )
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------
FILE: /var/www/web/modules/contrib/flood_unblock/tests/src/Functional/FloodUnblockUiPageTest.php
------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 8 LINES
------------------------------------------------------------------------------------------------
3 | ERROR | [x] There must be one blank line after the namespace declaration
25 | ERROR | [ ] Missing @var tag in member variable comment
26 | ERROR | [ ] Class property $admin_user should use lowerCamel naming without underscores
30 | ERROR | [ ] Missing @var tag in member variable comment
31 | ERROR | [ ] Class property $simple_user should use lowerCamel naming without underscores
33 | ERROR | [x] Missing function doc comment
45 | ERROR | [x] Missing function doc comment
56 | ERROR | [x] Missing function doc comment
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------
FILE: /var/www/web/modules/contrib/flood_unblock/src/FloodUnblockManager.php
-------------------------------------------------------------------------------------------------------------------
FOUND 17 ERRORS AFFECTING 15 LINES
-------------------------------------------------------------------------------------------------------------------
12 | ERROR | [x] Missing class doc comment
17 | ERROR | [x] Doc comment short description must end with a full stop
23 | ERROR | [ ] Missing short description in doc comment
28 | ERROR | [ ] Missing short description in doc comment
33 | ERROR | [ ] Missing short description in doc comment
45 | ERROR | [ ] Parameter $flood is not described in comment
45 | ERROR | [ ] Parameter $configFactory is not described in comment
45 | ERROR | [ ] Parameter $messenger is not described in comment
48 | ERROR | [ ] Missing parameter comment
49 | ERROR | [ ] Missing parameter comment
65 | ERROR | [ ] Public method name "FloodUnblockManager::get_blocked_ip_entries" is not in lowerCamel format
107 | ERROR | [ ] Public method name "FloodUnblockManager::get_blocked_user_entries" is not in lowerCamel format
141 | ERROR | [x] Expected newline after closing brace
163 | ERROR | [ ] Public method name "FloodUnblockManager::flood_unblock_clear_event" is not in lowerCamel format
175 | ERROR | [x] Expected newline after closing brace
182 | ERROR | [x] Expected 1 blank line after function; 0 found
183 | ERROR | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------
FILE: /var/www/web/modules/contrib/flood_unblock/src/Commands/FloodUnblockCommands.php
--------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------------
12 | ERROR | [x] Opening brace should be on the same line as the declaration
14 | ERROR | [ ] Missing short description in doc comment
15 | ERROR | [x] Data types in @var tags need to be fully namespaced
22 | ERROR | [ ] Missing parameter comment
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------
FILE: /var/www/web/modules/contrib/flood_unblock/src/Form/FloodUnblockAdminForm.php
---------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 1 WARNING AFFECTING 7 LINES
---------------------------------------------------------------------------------------
10 | WARNING | [x] Unused use statement
17 | ERROR | [ ] Missing short description in doc comment
22 | ERROR | [ ] Missing short description in doc comment
27 | ERROR | [x] Missing function doc comment
119 | ERROR | [x] Expected 1 blank line after function; 2 found
159 | ERROR | [x] Expected 1 blank line after function; 0 found
160 | ERROR | [x] The closing brace for the class must have an empty line before it
---------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------
Time: 4.21 secs; Memory: 10MB
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | interdiff_3-8.txt | 32.62 KB | nitesh624 |
| #8 | 3159161-8.patch | 8.98 KB | nitesh624 |
| #3 | Implement_coding_standards_3159161.patch | 25.8 KB | Pooja Ganjage |
Comments
Comment #2
batigolixComment #3
Pooja Ganjage commentedHi,
I am applying patch for coding standards.
Kindly review this patch once.
Thanks.
Comment #4
Pooja Ganjage commentedComment #5
batigolixMany thanks @pooja
I'll commit this when #3124512: Failed REST logins can only be cleared via Drush (not GUI) is done.
Comment #6
batigolixPooja Ganjage:
FloodUnblockManager.php has changed quite a bit since #3124512: Failed REST logins can only be cleared via Drush (not GUI)
You want to make a new patch?
Comment #7
nitesh624Working on it , will update shortly
Comment #8
nitesh624Comment #9
nitesh624Comment #10
fabianderijkThanks, this seems to be ok. I'm applying the patch
Comment #12
fabianderijkThis is now fixed in the 3.0.x branch
Comment #13
Pooja Ganjage commented