Closed (fixed)
Project:
Username
Version:
1.0.x-dev
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Reporter:
Created:
14 Mar 2024 at 10:12 UTC
Updated:
10 Dec 2024 at 11:01 UTC
Jump to comment: Most recent, Most recent file
The module must follow the correct Drupal coding standards. So, when developing it, make sure to run phpcs --standard=Drupal,DrupalPractice on the project. This will fix most issues that reviewers might find.
Run the following command:
phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml {module_path e.g /web/custom/module.}
FILE: /Users/mac/contribution/username/css/username.style.css
------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------
1 | ERROR | [x] Selectors must be on a single line
45 | ERROR | [x] CSS colours must be defined in lowercase; expected #b3cefb but found #B3CEFB
64 | ERROR | [x] CSS colours must be defined in lowercase; expected #d9e7fd but found #D9E7FD
139 | ERROR | [x] CSS colours must be defined in lowercase; expected #d9e7fd but found #D9E7FD
188 | ERROR | [x] CSS colours must be defined in lowercase; expected #b3cefb but found #B3CEFB
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------
7 | WARNING | Line exceeds 80 characters; contains 85 characters
13 | WARNING | Line exceeds 80 characters; contains 120 characters
25 | WARNING | Line exceeds 80 characters; contains 103 characters
----------------------------------------------------------------------
FILE: /Users/mac/contribution/username/username.module
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 31 ERRORS AND 15 WARNINGS AFFECTING 43 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
18 | WARNING | [x] Unused use statement
19 | WARNING | [x] Unused use statement
24 | WARNING | [x] Unused use statement
27 | ERROR | [x] Doc comment short description must end with a full stop
120 | ERROR | [x] Case breaking statements must be followed by a single blank line
123 | ERROR | [x] Case breaking statements must be followed by a single blank line
279 | ERROR | [x] Expected 1 space after comma in argument list; 2 found
279 | ERROR | [x] Expected one space after the comma, 2 found
497 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
856 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
889 | ERROR | [ ] The array declaration extends to column 96 (the limit is 80). The array content should be split up over multiple lines
939 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1 spaces
941 | ERROR | [ ] @return doc comment specified, but function has no return statement
942 | ERROR | [x] Return comment indentation must be 3 spaces, found 4 spaces
964 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
977 | WARNING | [ ] Only string literals should be passed to t() where possible
999 | WARNING | [ ] Only string literals should be passed to t() where possible
1024 | WARNING | [ ] Only string literals should be passed to t() where possible
1033 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1 spaces
1035 | ERROR | [ ] @return doc comment specified, but function has no return statement
1036 | ERROR | [x] Return comment indentation must be 3 spaces, found 4 spaces
1050 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
1058 | ERROR | [x] Expected 1 space before "="; 0 found
1063 | WARNING | [ ] Only string literals should be passed to t() where possible
1073 | WARNING | [ ] Only string literals should be passed to t() where possible
1081 | WARNING | [ ] Only string literals should be passed to t() where possible
1090 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1 spaces
1092 | ERROR | [ ] @return doc comment specified, but function has no return statement
1093 | ERROR | [x] Return comment indentation must be 3 spaces, found 4 spaces
1116 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
1129 | WARNING | [ ] Only string literals should be passed to t() where possible
1144 | WARNING | [ ] Only string literals should be passed to t() where possible
1144 | ERROR | [ ] The array declaration extends to column 118 (the limit is 80). The array content should be split up over multiple lines
1158 | WARNING | [ ] Only string literals should be passed to t() where possible
1174 | WARNING | [ ] Only string literals should be passed to t() where possible
1174 | ERROR | [ ] The array declaration extends to column 110 (the limit is 80). The array content should be split up over multiple lines
1188 | WARNING | [ ] Only string literals should be passed to t() where possible
1204 | WARNING | [ ] Only string literals should be passed to t() where possible
1213 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1 spaces
1215 | ERROR | [ ] @return doc comment specified, but function has no return statement
1216 | ERROR | [x] Return comment indentation must be 3 spaces, found 4 spaces
1274 | ERROR | [x] Case breaking statements must be followed by a single blank line
1277 | ERROR | [x] Case breaking statements must be followed by a single blank line
1280 | ERROR | [x] Case breaking statements must be followed by a single blank line
1283 | ERROR | [x] Case breaking statements must be followed by a single blank line
1286 | ERROR | [x] Case breaking statements must be followed by a single blank line
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 27 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/modules/username_phone/username_phone.module
---------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 4 WARNINGS AFFECTING 7 LINES
---------------------------------------------------------------------------------------------------------------------------------
11 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
14 | WARNING | [x] Unused use statement
20 | ERROR | [x] Language constructs must be followed by a single space; expected "return [" but found "return["
82 | ERROR | [x] Expected "bool" but found "boolean" for function return type
141 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
145 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
149 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
---------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/modules/username_phone/src/Form/UsernamePhoneForm.php
--------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------------------------
53 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
57 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
61 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
70 | WARNING | [ ] Possible useless method overriding detected
91 | WARNING | [ ] Possible useless method overriding detected
--------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/modules/username_phone/src/Plugin/Validation/Constraint/UsernamePhoneUnique.php
----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------
17 | ERROR | Missing member variable doc comment
----------------------------------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/modules/username_phone/src/Plugin/Validation/Constraint/UsernamePhoneRequiredValidator.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Symfony\Component\Validator\Constraint.
21 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
21 | ERROR | [ ] Description for the @return value is missing
43 | WARNING | [ ] Line exceeds 80 characters; contains 99 characters
43 | ERROR | [x] No space found before comment text; expected "// $required = !(!$existing_value && \Drupal::currentUser()->hasPermission('administer users'));" but found
| | "//$required = !(!$existing_value && \Drupal::currentUser()->hasPermission('administer users'));"
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/modules/username_displayname/username_displayname.module
-----------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------
15 | WARNING | [ ] Hook implementations should not duplicate @return documentation
16 | ERROR | [x] Return comment indentation must be 3 spaces, found 5 spaces
31 | WARNING | [ ] Hook implementations should not duplicate @return documentation
31 | ERROR | [ ] @return doc comment specified, but function has no return statement
32 | ERROR | [x] Return comment indentation must be 3 spaces, found 5 spaces
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/modules/username_displayname/username_displayname.install
------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 2 WARNINGS AFFECTING 6 LINES
------------------------------------------------------------------------------------------------
10 | ERROR | [x] Missing function doc comment
11 | ERROR | [x] Inline comments must start with a capital letter
20 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
21 | WARNING | [x] A comma should follow the last multiline array item. Found: ''
23 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
28 | ERROR | [x] Missing function doc comment
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/src/Form/UsernameSettingsForm.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 4 WARNINGS AFFECTING 7 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
7 | WARNING | [x] Unused use statement
10 | WARNING | [x] Unused use statement
11 | WARNING | [x] Unused use statement
30 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4 spaces
625 | WARNING | [ ] Line exceeds 80 characters; contains 174 characters
625 | ERROR | [x] No space found before comment text; expected "// $form_state->setErrorByName('restriction', $this->t('To restricts the username field, at least one of
| | uppercase and lowercase letters or numbers must be selected.'));" but found "//$form_state->setErrorByName('restriction', $this->t('To restricts the username
| | field, at least one of uppercase and lowercase letters or numbers must be selected.'));"
710 | ERROR | [x] Expected 1 blank line after function; 0 found
711 | ERROR | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/src/UsernameGenerator.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 33 ERRORS AND 1 WARNING AFFECTING 33 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
156 | WARNING | [x] There must be no blank line following an inline comment
156 | ERROR | [x] No space found before comment text; expected "// $new_name = username_unique_username($new_name, $account->id());" but found "//$new_name =
| | username_unique_username($new_name, $account->id());"
343 | ERROR | [ ] The array declaration extends to column 99 (the limit is 80). The array content should be split up over multiple lines
344 | ERROR | [ ] The array declaration extends to column 113 (the limit is 80). The array content should be split up over multiple lines
345 | ERROR | [ ] The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines
346 | ERROR | [ ] The array declaration extends to column 82 (the limit is 80). The array content should be split up over multiple lines
347 | ERROR | [ ] The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
348 | ERROR | [ ] The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
349 | ERROR | [ ] The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
350 | ERROR | [ ] The array declaration extends to column 82 (the limit is 80). The array content should be split up over multiple lines
351 | ERROR | [ ] The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines
352 | ERROR | [ ] The array declaration extends to column 96 (the limit is 80). The array content should be split up over multiple lines
353 | ERROR | [ ] The array declaration extends to column 95 (the limit is 80). The array content should be split up over multiple lines
354 | ERROR | [ ] The array declaration extends to column 96 (the limit is 80). The array content should be split up over multiple lines
355 | ERROR | [ ] The array declaration extends to column 96 (the limit is 80). The array content should be split up over multiple lines
356 | ERROR | [ ] The array declaration extends to column 97 (the limit is 80). The array content should be split up over multiple lines
357 | ERROR | [ ] The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines
358 | ERROR | [ ] The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
359 | ERROR | [ ] The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
360 | ERROR | [ ] The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines
361 | ERROR | [ ] The array declaration extends to column 89 (the limit is 80). The array content should be split up over multiple lines
362 | ERROR | [ ] The array declaration extends to column 82 (the limit is 80). The array content should be split up over multiple lines
363 | ERROR | [ ] The array declaration extends to column 88 (the limit is 80). The array content should be split up over multiple lines
364 | ERROR | [ ] The array declaration extends to column 107 (the limit is 80). The array content should be split up over multiple lines
365 | ERROR | [ ] The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
366 | ERROR | [ ] The array declaration extends to column 93 (the limit is 80). The array content should be split up over multiple lines
367 | ERROR | [ ] The array declaration extends to column 82 (the limit is 80). The array content should be split up over multiple lines
368 | ERROR | [ ] The array declaration extends to column 93 (the limit is 80). The array content should be split up over multiple lines
369 | ERROR | [ ] The array declaration extends to column 94 (the limit is 80). The array content should be split up over multiple lines
370 | ERROR | [ ] The array declaration extends to column 90 (the limit is 80). The array content should be split up over multiple lines
371 | ERROR | [ ] The array declaration extends to column 91 (the limit is 80). The array content should be split up over multiple lines
372 | ERROR | [ ] The array declaration extends to column 94 (the limit is 80). The array content should be split up over multiple lines
373 | ERROR | [ ] The array declaration extends to column 82 (the limit is 80). The array content should be split up over multiple lines
374 | ERROR | [ ] The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/src/Plugin/migrate/process/UsernameReplaceToken.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\migrate\MigrateExecutableInterface.
23 | ERROR | [x] list(...) is forbidden, use [...] instead.
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/src/Controller/UsernameAutocompleteController.php
-----------------------------------------------------------------------------------------------------------------------------------------
➜ username git:(1.0.x) ✗ /Users/mac/project/phpcs/vendor/bin/phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml /Users/mac/contribution/username
FILE: /Users/mac/contribution/username/css/username.style.css
------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------
1 | ERROR | [x] Selectors must be on a single line
45 | ERROR | [x] CSS colours must be defined in lowercase; expected #b3cefb but found #B3CEFB
64 | ERROR | [x] CSS colours must be defined in lowercase; expected #d9e7fd but found #D9E7FD
139 | ERROR | [x] CSS colours must be defined in lowercase; expected #d9e7fd but found #D9E7FD
188 | ERROR | [x] CSS colours must be defined in lowercase; expected #b3cefb but found #B3CEFB
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/username.module
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 31 ERRORS AND 15 WARNINGS AFFECTING 43 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
18 | WARNING | [x] Unused use statement
19 | WARNING | [x] Unused use statement
24 | WARNING | [x] Unused use statement
27 | ERROR | [x] Doc comment short description must end with a full stop
120 | ERROR | [x] Case breaking statements must be followed by a single blank line
123 | ERROR | [x] Case breaking statements must be followed by a single blank line
279 | ERROR | [x] Expected 1 space after comma in argument list; 2 found
279 | ERROR | [x] Expected one space after the comma, 2 found
497 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
856 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
889 | ERROR | [ ] The array declaration extends to column 96 (the limit is 80). The array content should be split up over multiple lines
939 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1 spaces
941 | ERROR | [ ] @return doc comment specified, but function has no return statement
942 | ERROR | [x] Return comment indentation must be 3 spaces, found 4 spaces
964 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
977 | WARNING | [ ] Only string literals should be passed to t() where possible
999 | WARNING | [ ] Only string literals should be passed to t() where possible
1024 | WARNING | [ ] Only string literals should be passed to t() where possible
1033 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1 spaces
1035 | ERROR | [ ] @return doc comment specified, but function has no return statement
1036 | ERROR | [x] Return comment indentation must be 3 spaces, found 4 spaces
1050 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
1058 | ERROR | [x] Expected 1 space before "="; 0 found
1063 | WARNING | [ ] Only string literals should be passed to t() where possible
1073 | WARNING | [ ] Only string literals should be passed to t() where possible
1081 | WARNING | [ ] Only string literals should be passed to t() where possible
1090 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1 spaces
1092 | ERROR | [ ] @return doc comment specified, but function has no return statement
1093 | ERROR | [x] Return comment indentation must be 3 spaces, found 4 spaces
1116 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
1129 | WARNING | [ ] Only string literals should be passed to t() where possible
1144 | WARNING | [ ] Only string literals should be passed to t() where possible
1144 | ERROR | [ ] The array declaration extends to column 118 (the limit is 80). The array content should be split up over multiple lines
1158 | WARNING | [ ] Only string literals should be passed to t() where possible
1174 | WARNING | [ ] Only string literals should be passed to t() where possible
1174 | ERROR | [ ] The array declaration extends to column 110 (the limit is 80). The array content should be split up over multiple lines
1188 | WARNING | [ ] Only string literals should be passed to t() where possible
1204 | WARNING | [ ] Only string literals should be passed to t() where possible
1213 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1 spaces
1215 | ERROR | [ ] @return doc comment specified, but function has no return statement
1216 | ERROR | [x] Return comment indentation must be 3 spaces, found 4 spaces
1274 | ERROR | [x] Case breaking statements must be followed by a single blank line
1277 | ERROR | [x] Case breaking statements must be followed by a single blank line
1280 | ERROR | [x] Case breaking statements must be followed by a single blank line
1283 | ERROR | [x] Case breaking statements must be followed by a single blank line
1286 | ERROR | [x] Case breaking statements must be followed by a single blank line
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 27 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/modules/username_phone/username_phone.module
---------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 4 WARNINGS AFFECTING 7 LINES
---------------------------------------------------------------------------------------------------------------------------------
11 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
14 | WARNING | [x] Unused use statement
20 | ERROR | [x] Language constructs must be followed by a single space; expected "return [" but found "return["
82 | ERROR | [x] Expected "bool" but found "boolean" for function return type
141 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
145 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
149 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
---------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/modules/username_phone/src/Form/UsernamePhoneForm.php
--------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------------------------
53 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
57 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
61 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
70 | WARNING | [ ] Possible useless method overriding detected
91 | WARNING | [ ] Possible useless method overriding detected
--------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/modules/username_phone/src/Plugin/Validation/Constraint/UsernamePhoneUnique.php
----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------
17 | ERROR | Missing member variable doc comment
----------------------------------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/modules/username_phone/src/Plugin/Validation/Constraint/UsernamePhoneRequiredValidator.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Symfony\Component\Validator\Constraint.
21 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
21 | ERROR | [ ] Description for the @return value is missing
43 | WARNING | [ ] Line exceeds 80 characters; contains 99 characters
43 | ERROR | [x] No space found before comment text; expected "// $required = !(!$existing_value && \Drupal::currentUser()->hasPermission('administer users'));" but found
| | "//$required = !(!$existing_value && \Drupal::currentUser()->hasPermission('administer users'));"
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/modules/username_displayname/username_displayname.module
-----------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------
15 | WARNING | [ ] Hook implementations should not duplicate @return documentation
16 | ERROR | [x] Return comment indentation must be 3 spaces, found 5 spaces
31 | WARNING | [ ] Hook implementations should not duplicate @return documentation
31 | ERROR | [ ] @return doc comment specified, but function has no return statement
32 | ERROR | [x] Return comment indentation must be 3 spaces, found 5 spaces
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/modules/username_displayname/username_displayname.install
------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 2 WARNINGS AFFECTING 6 LINES
------------------------------------------------------------------------------------------------
10 | ERROR | [x] Missing function doc comment
11 | ERROR | [x] Inline comments must start with a capital letter
20 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
21 | WARNING | [x] A comma should follow the last multiline array item. Found: ''
23 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
28 | ERROR | [x] Missing function doc comment
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/src/Form/UsernameSettingsForm.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 4 WARNINGS AFFECTING 7 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
7 | WARNING | [x] Unused use statement
10 | WARNING | [x] Unused use statement
11 | WARNING | [x] Unused use statement
30 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4 spaces
625 | WARNING | [ ] Line exceeds 80 characters; contains 174 characters
625 | ERROR | [x] No space found before comment text; expected "// $form_state->setErrorByName('restriction', $this->t('To restricts the username field, at least one of
| | uppercase and lowercase letters or numbers must be selected.'));" but found "//$form_state->setErrorByName('restriction', $this->t('To restricts the username
| | field, at least one of uppercase and lowercase letters or numbers must be selected.'));"
710 | ERROR | [x] Expected 1 blank line after function; 0 found
711 | ERROR | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/src/UsernameGenerator.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 33 ERRORS AND 1 WARNING AFFECTING 33 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
156 | WARNING | [x] There must be no blank line following an inline comment
156 | ERROR | [x] No space found before comment text; expected "// $new_name = username_unique_username($new_name, $account->id());" but found "//$new_name =
| | username_unique_username($new_name, $account->id());"
343 | ERROR | [ ] The array declaration extends to column 99 (the limit is 80). The array content should be split up over multiple lines
344 | ERROR | [ ] The array declaration extends to column 113 (the limit is 80). The array content should be split up over multiple lines
345 | ERROR | [ ] The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines
346 | ERROR | [ ] The array declaration extends to column 82 (the limit is 80). The array content should be split up over multiple lines
347 | ERROR | [ ] The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
348 | ERROR | [ ] The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
349 | ERROR | [ ] The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
350 | ERROR | [ ] The array declaration extends to column 82 (the limit is 80). The array content should be split up over multiple lines
351 | ERROR | [ ] The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines
352 | ERROR | [ ] The array declaration extends to column 96 (the limit is 80). The array content should be split up over multiple lines
353 | ERROR | [ ] The array declaration extends to column 95 (the limit is 80). The array content should be split up over multiple lines
354 | ERROR | [ ] The array declaration extends to column 96 (the limit is 80). The array content should be split up over multiple lines
355 | ERROR | [ ] The array declaration extends to column 96 (the limit is 80). The array content should be split up over multiple lines
356 | ERROR | [ ] The array declaration extends to column 97 (the limit is 80). The array content should be split up over multiple lines
357 | ERROR | [ ] The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines
358 | ERROR | [ ] The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
359 | ERROR | [ ] The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
360 | ERROR | [ ] The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines
361 | ERROR | [ ] The array declaration extends to column 89 (the limit is 80). The array content should be split up over multiple lines
362 | ERROR | [ ] The array declaration extends to column 82 (the limit is 80). The array content should be split up over multiple lines
363 | ERROR | [ ] The array declaration extends to column 88 (the limit is 80). The array content should be split up over multiple lines
364 | ERROR | [ ] The array declaration extends to column 107 (the limit is 80). The array content should be split up over multiple lines
365 | ERROR | [ ] The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
366 | ERROR | [ ] The array declaration extends to column 93 (the limit is 80). The array content should be split up over multiple lines
367 | ERROR | [ ] The array declaration extends to column 82 (the limit is 80). The array content should be split up over multiple lines
368 | ERROR | [ ] The array declaration extends to column 93 (the limit is 80). The array content should be split up over multiple lines
369 | ERROR | [ ] The array declaration extends to column 94 (the limit is 80). The array content should be split up over multiple lines
370 | ERROR | [ ] The array declaration extends to column 90 (the limit is 80). The array content should be split up over multiple lines
371 | ERROR | [ ] The array declaration extends to column 91 (the limit is 80). The array content should be split up over multiple lines
372 | ERROR | [ ] The array declaration extends to column 94 (the limit is 80). The array content should be split up over multiple lines
373 | ERROR | [ ] The array declaration extends to column 82 (the limit is 80). The array content should be split up over multiple lines
374 | ERROR | [ ] The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/src/Plugin/migrate/process/UsernameReplaceToken.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\migrate\MigrateExecutableInterface.
23 | ERROR | [x] list(...) is forbidden, use [...] instead.
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/src/Controller/UsernameAutocompleteController.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Component\Utility\Crypt.
24 | ERROR | [ ] The array declaration extends to column 92 (the limit is 80). The array content should be split up over multiple lines
73 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------
FILE: /Users/mac/contribution/username/src/Routing/UsernameRouteSubscriber.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------------------------
11 | WARNING | [x] Unused use statement
19 | WARNING | [x] Unused use statement
19 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\username\Form\UsernameRegisterForm.
20 | WARNING | [x] Unused use statement
--------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------
Time: 371ms; Memory: 16MB
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | Screenshot from 2024-06-06 17-14-14.png | 19.96 KB | silvi.addweb |
| #18 | Screenshot from 2024-06-06 17-04-46.png | 172.31 KB | silvi.addweb |
| #12 | username.png | 26.06 KB | sakthi_dev |
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 #2
richa_porwal commentedComment #3
richa_porwal commentedComment #10
pray_12 commentedComment #12
sakthi_dev commentedPlease review.
Comment #13
paraderojether commentedHi
I reviewed MR!1, applied it against Username 1.0.x-dev, confirmed MR was applied successfully, and fixed all the issues reported by phpcs.
Thank you.
Comment #14
avpadernoComment #15
avpadernoThe lines that pass a dynamic value to
t()must be checked. Using code similar to the following one is not correct, though, since it does not translate the string used instead of the placeholder. (The purpose of placeholders is adding to a string to translate parts that do not need to be translated.)That code is exactly the same as the following one.
Comment #16
gaurav gupta commentedFixed all the phpcs issues .
Please check.
Comment #17
silvi.addweb commentedI have checked and it's working fine.
Comment #18
silvi.addweb commentedComment #19
sourav_paul@Gaurav Gupta Could you please solve the merge conflict...
Comment #20
gaurav gupta commentedComment #21
mahyarsbt commentedThank you for your feedback and for pointing out the issues. The current development version of the module has been available as an alpha release for quite some time. This version was released during the very early stages of development, and at that time, the code was still incomplete and in the process of being structured.
I want to clarify that the coding standard issues reported are from that early phase, and since then, the code has been significantly improved and aligned with Drupal's standards. I appreciate your observations, but as the module has now evolved past this initial stage, I will be closing this issue.
Comment #22
mahyarsbt commentedI encourage you to test the current alpha version, and please feel free to provide feedback or report any new issues you encounter.