Drupal classes should not use t() to translate strings, but use dependency injection, for example via StringTranslationTrait.

CommentFileSizeAuthor
#2 3427315-2.patch5.13 KBchaitanyadessai
Command icon 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

chaitanyadessai created an issue. See original summary.

chaitanyadessai’s picture

Assigned: chaitanyadessai » Unassigned
Status: Active » Needs review
StatusFileSize
new5.13 KB

Please review.

avpaderno’s picture

Title: t() calls should be avoided in classes. » t() calls should be avoided in classes
Priority: Normal » Minor
Issue summary: View changes
avpaderno’s picture

Issue summary: View changes

cleavinjosh’s picture

Status: Needs review » Needs work

Hi @apaderno,

I applied MR!14, it was applied smoothly and fixed all the t() calls issues.

However, when I run phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml, I encountered some issues.

➜  force_password_change git:(2.0.x) curl https://git.drupalcode.org/project/force_password_change/-/merge_requests/14.diff | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7302    0  7302    0     0  11706      0 --:--:-- --:--:-- --:--:-- 11701
patching file src/Entity/User/ForcePasswordChangeRoleListBuilder.php
patching file src/EventSubscriber/ForcePasswordChangeConfigPostUpdateSubscriber.php
patching file src/EventSubscriber/ForcePasswordChangeEventSubscriber.php
patching file src/Service/ForcePasswordChangeService.php
➜  force_password_change git:(2.0.x) ✗ ..
➜  contrib git:(main) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml force_password_change

FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/force_password_change/force_password_change.install
----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------
 3 | ERROR | Missing short description in doc comment
----------------------------------------------------------------------------------------------------------------------


FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/force_password_change/tests/src/Unit/Service/ForcePasswordChangeServiceTest.php
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 11 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\force_password_change_service_test\Service\ForcePasswordChangeServiceTest.
 29 | ERROR | [ ] Missing @var tag in member variable comment
 34 | ERROR | [ ] Missing @var tag in member variable comment
 39 | ERROR | [ ] Missing @var tag in member variable comment
 44 | ERROR | [ ] Missing @var tag in member variable comment
 49 | ERROR | [ ] Missing @var tag in member variable comment
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/force_password_change/tests/src/Functional/ForcePasswordChangeBrowserTestBase.php
----------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 19 ERRORS AFFECTING 19 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------
  12 | ERROR | Doc comment is empty
  19 | ERROR | Doc comment is empty
  26 | ERROR | Doc comment is empty
  33 | ERROR | Doc comment is empty
  40 | ERROR | Doc comment is empty
  47 | ERROR | Doc comment is empty
  54 | ERROR | Doc comment is empty
  61 | ERROR | Doc comment is empty
  68 | ERROR | Doc comment is empty
  81 | ERROR | Doc comment is empty
  95 | ERROR | Doc comment is empty
 110 | ERROR | Doc comment is empty
 117 | ERROR | Doc comment is empty
 131 | ERROR | Doc comment is empty
 146 | ERROR | Doc comment is empty
 159 | ERROR | Doc comment is empty
 170 | ERROR | Doc comment is empty
 181 | ERROR | Doc comment is empty
 192 | ERROR | Doc comment is empty
----------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/force_password_change/tests/src/Functional/ForcePasswordChangeAdminUiTest.php
------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 10 WARNINGS AFFECTING 6 LINES
------------------------------------------------------------------------------------------------------------------------------------------------
  5 | ERROR   | [ ] Missing short description in doc comment
 26 | ERROR   | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
 56 | WARNING | [ ] Line exceeds 80 characters; contains 200 characters
 56 | WARNING | [x] There must be no blank line following an inline comment
 56 | WARNING | [ ] There must be no blank line following an inline comment
 69 | WARNING | [ ] Line exceeds 80 characters; contains 184 characters
 69 | WARNING | [x] There must be no blank line following an inline comment
 69 | WARNING | [ ] There must be no blank line following an inline comment
 89 | WARNING | [ ] Line exceeds 80 characters; contains 249 characters
 91 | WARNING | [ ] Line exceeds 80 characters; contains 233 characters
 91 | WARNING | [x] There must be no blank line following an inline comment
 91 | WARNING | [ ] There must be no blank line following an inline comment
------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/force_password_change/force_password_change.module
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 453 ERRORS AND 8 WARNINGS AFFECTING 188 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
   3 | ERROR   | [ ] Missing short description in doc comment
  17 | ERROR   | [x] Opening brace should be on the same line as the declaration
  18 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  18 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
  18 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  19 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  19 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
  19 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
  19 | ERROR   | [x] Expected 1 space after closing parenthesis; found 2
  20 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  20 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
  21 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  21 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  22 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  22 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  22 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  23 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  23 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  23 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
  23 | ERROR   | [x] Expected 1 space after closing parenthesis; found 3
  24 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  24 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  25 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  25 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  26 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  26 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  27 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  27 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  27 | ERROR   | [x] Expected 1 space after ELSE keyword; newline found
  28 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  28 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  29 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  29 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  30 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  30 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  32 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  32 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  32 | ERROR   | [x] Short array syntax must be used to define arrays
  32 | ERROR   | [x] There must be no space between the "array" keyword and the opening parenthesis
  33 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  33 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  33 | ERROR   | [x] Array indentation error, expected 4 spaces but found 2
  34 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  34 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
  34 | ERROR   | [x] Array indentation error, expected 4 spaces but found 3
  35 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  35 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
  35 | ERROR   | [x] Array indentation error, expected 4 spaces but found 3
  36 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  36 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
  36 | ERROR   | [x] Array indentation error, expected 4 spaces but found 3
  37 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  39 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  39 | WARNING | [ ] Line exceeds 80 characters; contains 92 characters
  39 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  39 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  40 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  40 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  41 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  41 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
  42 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  42 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
  42 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  43 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  43 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
  43 | ERROR   | [x] Expected 1 space after ELSEIF keyword; 0 found
  43 | ERROR   | [x] Expected 1 space after closing parenthesis; found 2
  44 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  44 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
  45 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  45 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  46 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  46 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  46 | ERROR   | [x] Short array syntax must be used to define arrays
  46 | ERROR   | [x] There must be no space between the "array" keyword and the opening parenthesis
  47 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  47 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  47 | ERROR   | [x] Array indentation error, expected 4 spaces but found 2
  48 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  48 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
  48 | ERROR   | [x] Array indentation error, expected 4 spaces but found 3
  49 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  49 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
  49 | ERROR   | [x] Array indentation error, expected 4 spaces but found 3
  50 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  52 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  52 | WARNING | [ ] Line exceeds 80 characters; contains 100 characters
  52 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  52 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  53 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  53 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  54 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  54 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
  55 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  55 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
  55 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  56 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  56 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
  56 | ERROR   | [x] Expected 1 space after ELSEIF keyword; 0 found
  56 | ERROR   | [x] Expected 1 space after closing parenthesis; found 2
  57 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  57 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
  59 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  59 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  60 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  60 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  60 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  61 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  61 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  61 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
  61 | ERROR   | [x] Expected 1 space after closing parenthesis; found 3
  62 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  62 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
  63 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  63 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  64 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  64 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  64 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  65 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  65 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  65 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
  65 | ERROR   | [x] Expected 1 space after closing parenthesis; found 4
  66 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  66 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  67 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  67 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 4
  68 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  68 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  69 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  69 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  69 | ERROR   | [x] Expected 1 space after ELSE keyword; newline found
  70 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  70 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  71 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  71 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 4
  72 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  72 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  73 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  73 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  74 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  74 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  74 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  75 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  75 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  76 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  76 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  78 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  78 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  78 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  79 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  79 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  79 | ERROR   | [x] Short array syntax must be used to define arrays
  79 | ERROR   | [x] There must be no space between the "array" keyword and the opening parenthesis
  80 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  80 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  80 | ERROR   | [x] Array indentation error, expected 5 spaces but found 3
  81 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  81 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
  81 | ERROR   | [x] Array indentation error, expected 5 spaces but found 4
  82 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  82 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
  82 | ERROR   | [x] Array indentation error, expected 5 spaces but found 4
  83 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  83 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
  83 | ERROR   | [x] Array indentation error, expected 5 spaces but found 4
  84 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  85 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  85 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  85 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  86 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  86 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  87 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  87 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  87 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
  87 | ERROR   | [x] Expected 1 space after closing parenthesis; found 4
  88 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  88 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  89 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  89 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 4
  90 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  90 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  92 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  92 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  92 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  93 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  93 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  93 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
  93 | ERROR   | [x] Expected 1 space after closing parenthesis; found 4
  94 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  94 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  95 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  95 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 4
  96 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  96 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  97 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  97 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  97 | ERROR   | [x] Expected 1 space after ELSE keyword; newline found
  98 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  98 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
  99 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
  99 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 4
 100 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 100 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 101 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 101 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 101 | ERROR   | [x] Short array syntax must be used to define arrays
 101 | ERROR   | [x] There must be no space between the "array" keyword and the opening parenthesis
 102 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 102 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 102 | ERROR   | [x] Array indentation error, expected 5 spaces but found 3
 103 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 103 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
 103 | ERROR   | [x] Array indentation error, expected 5 spaces but found 4
 104 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 104 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
 104 | ERROR   | [x] Array indentation error, expected 5 spaces but found 4
 105 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 105 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
 105 | ERROR   | [x] Array indentation error, expected 5 spaces but found 4
 106 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 106 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
 106 | ERROR   | [x] Array indentation error, expected 5 spaces but found 4
 107 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 109 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 109 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 109 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 110 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 110 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 111 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 111 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 111 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
 111 | ERROR   | [x] Expected 1 space after closing parenthesis; found 4
 112 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 112 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 113 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 113 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 4
 114 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 114 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 115 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 115 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 115 | ERROR   | [x] Expected 1 space after ELSEIF keyword; 0 found
 115 | ERROR   | [x] Expected 1 space after closing parenthesis; found 4
 116 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 116 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 117 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 117 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 4
 118 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 118 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 119 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 119 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 119 | ERROR   | [x] Expected 1 space after ELSE keyword; newline found
 120 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 120 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 121 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 121 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 4
 122 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 122 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 4
 122 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
 122 | ERROR   | [x] Expected 1 space after closing parenthesis; found 5
 123 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 123 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 4
 124 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 124 | ERROR   | [x] Line indented incorrectly; expected 10 spaces, found 5
 125 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 125 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 4
 126 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 126 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 4
 126 | ERROR   | [x] Expected 1 space after ELSE keyword; newline found
 127 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 127 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 4
 128 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 128 | ERROR   | [x] Line indented incorrectly; expected 10 spaces, found 5
 129 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 129 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 4
 130 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 130 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 132 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 132 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 133 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 133 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 134 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 134 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 135 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 135 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 137 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 137 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 137 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 138 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 138 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 139 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 139 | ERROR   | [x] Line indented incorrectly; expected at least 6 spaces, found 4
 139 | ERROR   | [x] Array indentation error, expected 5 spaces but found 4
 140 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 140 | ERROR   | [x] Line indented incorrectly; expected at least 6 spaces, found 5
 140 | ERROR   | [x] Array indentation error, expected 6 spaces but found 5
 141 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 141 | ERROR   | [x] Line indented incorrectly; expected at least 6 spaces, found 5
 141 | ERROR   | [x] Array indentation error, expected 6 spaces but found 5
 142 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 142 | ERROR   | [x] Line indented incorrectly; expected at least 6 spaces, found 5
 142 | ERROR   | [x] Array indentation error, expected 6 spaces but found 5
 143 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 144 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 144 | ERROR   | [x] Line indented incorrectly; expected at least 6 spaces, found 4
 144 | ERROR   | [x] Array indentation error, expected 5 spaces but found 4
 145 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 145 | ERROR   | [x] Line indented incorrectly; expected at least 6 spaces, found 5
 145 | ERROR   | [x] Array indentation error, expected 6 spaces but found 5
 146 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 146 | ERROR   | [x] Line indented incorrectly; expected at least 6 spaces, found 5
 146 | ERROR   | [x] Array indentation error, expected 6 spaces but found 5
 147 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 148 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 149 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 149 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 151 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 151 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 151 | ERROR   | [ ] The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('pass-reset-token') instead
 151 | ERROR   | [ ] The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get('pass-reset-token') instead
 152 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 152 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 153 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 153 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 154 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 154 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 155 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 155 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 155 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
 155 | ERROR   | [x] Expected 1 space after closing parenthesis; found 3
 156 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 156 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 157 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 157 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 158 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 158 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 159 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 159 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 160 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 160 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 161 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 161 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 162 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 162 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 162 | ERROR   | [ ] The array declaration extends to column 289 (the limit is 120). The array content should be split up over multiple lines
 163 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 163 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 165 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 165 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
 165 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 165 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 166 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 166 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 166 | ERROR   | [x] Short array syntax must be used to define arrays
 166 | ERROR   | [x] There must be no space between the "array" keyword and the opening parenthesis
 167 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 167 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 167 | ERROR   | [x] Array indentation error, expected 4 spaces but found 2
 168 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 168 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
 168 | ERROR   | [x] Array indentation error, expected 4 spaces but found 3
 169 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 169 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
 169 | ERROR   | [x] Array indentation error, expected 4 spaces but found 3
 170 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 172 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 172 | WARNING | [ ] Line exceeds 80 characters; contains 103 characters
 172 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 173 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 173 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 173 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 174 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 174 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 175 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 175 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 176 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 176 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
 177 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 177 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
 177 | ERROR   | [x] Expected 1 space after ELSEIF keyword; 0 found
 177 | ERROR   | [x] Expected 1 space after closing parenthesis; found 2
 178 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 178 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
 179 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 179 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 180 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 180 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 180 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 181 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 181 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 181 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
 181 | ERROR   | [x] Expected 1 space after closing parenthesis; found 3
 182 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 182 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 183 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 183 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 183 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 184 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 184 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 184 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
 184 | ERROR   | [x] Expected 1 space after closing parenthesis; found 4
 185 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 185 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 186 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 186 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 4
 187 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 187 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 188 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 188 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 188 | ERROR   | [x] Expected 1 space after ELSE keyword; newline found
 189 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 189 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 190 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 190 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 4
 191 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 191 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 192 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 192 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 193 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 193 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 194 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 194 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 195 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 195 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 196 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 196 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 197 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 197 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 197 | ERROR   | [x] Short array syntax must be used to define arrays
 197 | ERROR   | [x] There must be no space between the "array" keyword and the opening parenthesis
 198 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 198 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 198 | ERROR   | [x] Array indentation error, expected 5 spaces but found 3
 199 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 199 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
 199 | ERROR   | [x] Array indentation error, expected 5 spaces but found 4
 200 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 200 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
 200 | ERROR   | [x] Array indentation error, expected 5 spaces but found 4
 201 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 201 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
 201 | ERROR   | [x] Array indentation error, expected 5 spaces but found 4
 202 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 202 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
 202 | ERROR   | [x] Array indentation error, expected 5 spaces but found 4
 203 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 204 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 204 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 3
 205 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 205 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 206 | ERROR   | [x] Spaces must be used to indent lines; tabs are not allowed
 206 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
 219 | ERROR   | [ ] The $_REQUEST super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->request->get('form_id') instead
 219 | ERROR   | [ ] The $_REQUEST super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->request->get('form_id') instead
 250 | WARNING | [ ] Unused variable $query.
 263 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
 275 | ERROR   | [ ] Doc comment is empty
 282 | WARNING | [ ] Unused variable $db.
 309 | ERROR   | [ ] Doc comment is empty
 327 | ERROR   | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
 339 | WARNING | [ ] Line exceeds 80 characters; contains 95 characters
 374 | WARNING | [ ] Unused variable $query.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 444 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/force_password_change/src/Form/AdminForm.php
---------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 5 WARNINGS AFFECTING 9 LINES
---------------------------------------------------------------------------------------------------------------
  16 | ERROR   | Doc comment is empty
  68 | ERROR   | Doc comment is empty
  75 | ERROR   | Doc comment is empty
 103 | WARNING | Role::loadMultiple calls should be avoided in classes, use dependency injection instead
 306 | ERROR   | Doc comment is empty
 356 | WARNING | Role::loadMultiple calls should be avoided in classes, use dependency injection instead
 369 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 373 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 376 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
---------------------------------------------------------------------------------------------------------------


FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/force_password_change/src/Form/RoleForceForm.php
-------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 2 WARNINGS AFFECTING 6 LINES
-------------------------------------------------------------------------------------------------------------------
  13 | ERROR   | Doc comment is empty
  65 | ERROR   | Doc comment is empty
  72 | ERROR   | Doc comment is empty
 117 | ERROR   | Doc comment is empty
 147 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 150 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
-------------------------------------------------------------------------------------------------------------------


FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/force_password_change/src/Entity/User/ForcePasswordChangeRoleListBuilder.php
-----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------
  7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\StringTranslation\StringTranslationTrait.
 10 | ERROR | [ ] Doc comment is empty
-----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/force_password_change/src/Mapper/ForcePasswordChangeMapper.php
---------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------------------
   7 | ERROR   | Doc comment is empty
 150 | WARNING | Unused variable $alias.
---------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/force_password_change/src/Mapper/ForcePasswordChangeMapperInterface.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 4 WARNINGS AFFECTING 10 LINES
------------------------------------------------------------------------------------------------------------------------------------------
   5 | ERROR   | Doc comment is empty
  45 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
  58 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
  67 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
  81 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
 106 | WARNING | Line exceeds 80 characters; contains 96 characters
 119 | WARNING | Line exceeds 80 characters; contains 99 characters
 152 | WARNING | Line exceeds 80 characters; contains 84 characters
 161 | WARNING | Line exceeds 80 characters; contains 93 characters
 171 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/force_password_change/src/Controller/ForcePasswordChangeControllerInterface.php
--------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------------------------------------
  5 | ERROR | Doc comment is empty
 10 | ERROR | Doc comment is empty
 15 | ERROR | Doc comment is empty
--------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/force_password_change/src/Controller/ForcePasswordChangeController.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
  17 | ERROR   | Doc comment is empty
 102 | ERROR   | Doc comment is empty
 116 | ERROR   | Doc comment is empty
 126 | WARNING | Role::load calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/force_password_change/src/Service/ForcePasswordChangeServiceInterface.php
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 5 WARNINGS AFFECTING 11 LINES
--------------------------------------------------------------------------------------------------------------------------------------------
   5 | ERROR   | Doc comment is empty
  30 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
  47 | WARNING | Line exceeds 80 characters; contains 84 characters
  60 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
  68 | WARNING | Line exceeds 80 characters; contains 85 characters
  84 | ERROR   | Missing parameter type
  87 | ERROR   | Missing parameter type
 123 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
 185 | WARNING | Line exceeds 80 characters; contains 85 characters
 195 | WARNING | Line exceeds 80 characters; contains 93 characters
 205 | WARNING | Line exceeds 80 characters; contains 93 characters
--------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/force_password_change/src/Service/ForcePasswordChangeRedirectMiddleware.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
  8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Symfony\Component\HttpFoundation\RedirectResponse.
 42 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/force_password_change/src/Service/ForcePasswordChangeService.php
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------------------
  11 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\user\Entity\User.
  13 | ERROR | [ ] Doc comment is empty
 300 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
 314 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
-----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/force_password_change/src/EventSubscriber/ForcePasswordChangeEventSubscriber.php
---------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------------------
 16 | ERROR | Doc comment is empty
---------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/force_password_change/src/EventSubscriber/ForcePasswordChangeConfigPostUpdateSubscriber.php
--------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------------------------
 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Config\ConfigCrudEvent.
--------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 834ms; Memory: 12MB

➜  contrib git:(main) ✗

Thank you.

avpaderno’s picture

Status: Needs work » Needs review

This issue is for avoiding to use t() in classes, where possible, not to fix all the warnings/errors reported by PHP_CodeSniffer.

heddn’s picture

Title: t() calls should be avoided in classes » Fix PHPCS
Status: Needs review » Needs work

Thanks #7 for your input. I typically would agree with you. But since this and #3426541: \Drupal calls should be avoided in classes, use dependency injection instead are dealing with 2 different phpcs things I wonder if we should just re-title/re-purpose to fix all phpcs issues in one shot. Instead of having to review several distinct issues. With that mind, re-titling and closing the other as duplicate to this.

NW to address all PHPCS.

somesh1999 made their first commit to this issue’s fork.

sdhruvi5142’s picture

Assigned: Unassigned » sdhruvi5142

Identifying and fixing all the phpcs issues.

sdhruvi5142’s picture

Assigned: sdhruvi5142 » Unassigned
Status: Needs work » Needs review

Fixed all the PHPcs issues as per the comment #8 in this issue only
Created and MR for the issues Fixed.

Moving this to Needs review for quick checkes.
can be moved to RTBC.

heddn’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Needs a rebase

jeremy1606 made their first commit to this issue’s fork.

jerech’s picture

Status: Needs work » Needs review

Refactored multiple classes to eliminate direct \Drupal service calls, replacing them with proper dependency injection. Updated constructors and .services.yml definitions where needed. This includes forms, event subscribers, mappers, and the role list builder. As a result, all PHPCS violations related to service usage have been resolved. PHPUnit tests were re-run and confirmed to pass after the changes.

schillerm made their first commit to this issue’s fork.

schillerm’s picture

Hi, I just ran phpcs on !MR18 and got this back ..

phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml web/modules/contrib/force_password_change

FILE: ...topuser/Documents/Issues/Dev-11-3427315/web/modules/contrib/force_password_change/tests/src/Kernel/ForcePasswordChangeTest.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
14 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\KernelTests\KernelTestBase.
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------

FILE: .../laptopuser/Documents/Issues/Dev-11-3427315/web/modules/contrib/force_password_change/src/Mapper/ForcePasswordChangeMapper.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Component\Datetime\TimeInterface.
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------

FILE: ...Dev-11-3427315/web/modules/contrib/force_password_change/src/EventSubscriber/ForcePasswordChangeConfigPostUpdateSubscriber.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Config\ConfigCrudEvent.
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------

FILE: ...ocuments/Issues/Dev-11-3427315/web/modules/contrib/force_password_change/src/Service/ForcePasswordChangeRedirectMiddleware.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
| | Symfony\Component\HttpFoundation\RedirectResponse.
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------

FILE: ...aptopuser/Documents/Issues/Dev-11-3427315/web/modules/contrib/force_password_change/src/Service/ForcePasswordChangeService.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\user\Entity\User.
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------

FILE: /home/laptopuser/Documents/Issues/Dev-11-3427315/web/modules/contrib/force_password_change/README.md
----------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
----------------------------------------------------------------------------------------------------------
3 | WARNING | Line exceeds 80 characters; contains 108 characters
4 | WARNING | Line exceeds 80 characters; contains 102 characters
9 | WARNING | Line exceeds 80 characters; contains 106 characters
10 | WARNING | Line exceeds 80 characters; contains 112 characters
12 | WARNING | Line exceeds 80 characters; contains 108 characters
14 | WARNING | Line exceeds 80 characters; contains 111 characters
15 | WARNING | Line exceeds 80 characters; contains 107 characters
----------------------------------------------------------------------------------------------------------

Time: 271ms; Memory: 14MB

So I fixed these errors and pushed up a commit with my changes.

heddn’s picture

Status: Needs review » Needs work
Issue tags: -Needs reroll

Left some feedback on the MR.

schillerm’s picture

Hi, I have pushed up changes which should hopefully fix this (#18). This is the first time I have worked on .gitlab-ci.yml so please check this. I have gitlab-ci-local set up locally to try to run gitlab-ci but it this case it was not able to run.

heddn’s picture

Feedback posted on MR.

jerech’s picture

Status: Needs work » Needs review
schillerm’s picture

Hi, I was getting these three unknown words when running cspell.

Unknown word (uids)
Unknown word (tabledrag)
Unknown word (prophesize)

so added reviewed them and then added them to the list.

heddn’s picture

Status: Needs review » Needs work

That last change needs to revert I think. See MR comments.

schillerm’s picture

apologies , will revert that last commit and push it up.

heddn’s picture

Status: Needs work » Needs review

  • heddn committed e3429838 on 2.0.x authored by sdhruvi5142
    feat: #3427315 Fix PHPCS
    
    By: avpaderno
    By: heddn
    By: jeremy1606
    By:...
heddn’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.