PHPCS Drupal coding standard issue in the abstractpermissions contrib module

Created on 15 December 2022, about 2 years ago
Updated 11 July 2024, 7 months ago

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,yaml,feature,js,json,ts,tsx,feature,twig abstractpermissions/

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\abstractpermissions.info.yml
---------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------
1 | WARNING | "Description" property is missing in the info.yml file
---------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\abstractpermissions.module
-------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
43 | ERROR | [ ] Missing short description in doc comment
44 | ERROR | [ ] Description for the @return value is missing
71 | ERROR | [x] Missing function doc comment
-------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\css\abstractpermissions-mark-governed.css
----------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
3 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\css\abstractpermissions-permissions-form.css
-------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\src\AbstractPermissionsService.php
---------------------------------------------------------------------------------------------------------
FOUND 13 ERRORS AFFECTING 13 LINES
---------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
10 | ERROR | [x] Missing class doc comment
14 | ERROR | [ ] Missing short description in doc comment
19 | ERROR | [ ] Missing short description in doc comment
24 | ERROR | [ ] Missing short description in doc comment
29 | ERROR | [ ] Missing short description in doc comment
37 | ERROR | [ ] Missing parameter comment
38 | ERROR | [ ] Missing parameter comment
66 | ERROR | [x] Missing function doc comment
71 | ERROR | [x] Missing function doc comment
82 | ERROR | [ ] Missing parameter comment
95 | ERROR | [x] Missing function doc comment
103 | ERROR | [x] Missing function doc comment
---------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\src\AbstractPermissionsServiceInterface.php
------------------------------------------------------------------------------------------------------------------
FOUND 12 ERRORS AFFECTING 10 LINES
------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
7 | ERROR | [x] Missing interface doc comment
12 | ERROR | [ ] Description for the @return value is missing
19 | ERROR | [ ] Description for the @return value is missing
20 | ERROR | [x] Doc comment star missing
31 | ERROR | [ ] Description for the @return value is missing
38 | ERROR | [ ] If there is no return value for a function, there must not be a @return tag.
38 | ERROR | [ ] Description for the @return value is missing
45 | ERROR | [ ] Missing parameter comment
46 | ERROR | [x] Doc comment star missing
47 | ERROR | [ ] If there is no return value for a function, there must not be a @return tag.
47 | ERROR | [ ] Description for the @return value is missing
------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\src\Entity\PermissionAbstraction.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 19 ERRORS AND 2 WARNINGS AFFECTING 21 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
91 | ERROR | [ ] Missing short description in doc comment
98 | ERROR | [ ] Missing short description in doc comment
105 | ERROR | [ ] Missing short description in doc comment
112 | ERROR | [ ] Missing short description in doc comment
119 | ERROR | [ ] Missing short description in doc comment
126 | ERROR | [ ] Missing short description in doc comment
133 | ERROR | [ ] Missing short description in doc comment
137 | ERROR | [x] Use null coalesce operator instead of ternary operator.
140 | ERROR | [ ] Missing short description in doc comment
149 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
151 | WARNING | [x] A comma should follow the last multiline array item. Found: $label
159 | ERROR | [ ] Missing short description in doc comment
166 | ERROR | [ ] Missing short description in doc comment
170 | ERROR | [x] Use null coalesce operator instead of ternary operator.
173 | ERROR | [ ] Missing short description in doc comment
180 | ERROR | [ ] Missing short description in doc comment
184 | ERROR | [x] Use null coalesce operator instead of ternary operator.
187 | ERROR | [ ] Missing short description in doc comment
194 | ERROR | [ ] Missing short description in doc comment
198 | ERROR | [x] list(...) is forbidden, use [...] instead.
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\src\Entity\PermissionAbstractionInterface.php
--------------------------------------------------------------------------------------------------------------------
FOUND 32 ERRORS AFFECTING 30 LINES
--------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
7 | ERROR | [x] Missing interface doc comment
9 | ERROR | [ ] Missing short description in doc comment
10 | ERROR | [ ] Description for the @return value is missing
14 | ERROR | [ ] Missing short description in doc comment
15 | ERROR | [ ] Missing parameter comment
19 | ERROR | [ ] Missing short description in doc comment
20 | ERROR | [ ] Description for the @return value is missing
24 | ERROR | [ ] Missing short description in doc comment
25 | ERROR | [ ] Missing parameter comment
29 | ERROR | [ ] Missing short description in doc comment
30 | ERROR | [ ] Description for the @return value is missing
34 | ERROR | [ ] Missing short description in doc comment
35 | ERROR | [ ] Missing parameter comment
42 | ERROR | [ ] Description for the @return value is missing
49 | ERROR | [ ] Description for the @return value is missing
56 | ERROR | [ ] Missing parameter comment
58 | ERROR | [ ] Type hint "array" missing for $abstractedPermissions
60 | ERROR | [ ] Missing short description in doc comment
61 | ERROR | [ ] Description for the @return value is missing
65 | ERROR | [ ] Missing short description in doc comment
66 | ERROR | [ ] Missing parameter comment
66 | ERROR | [ ] Missing parameter type
73 | ERROR | [ ] Description for the @return value is missing
77 | ERROR | [ ] Missing short description in doc comment
78 | ERROR | [ ] Missing parameter comment
80 | ERROR | [ ] Type hint "array" missing for $permissionMapping
85 | ERROR | [ ] Missing parameter comment
86 | ERROR | [ ] Missing parameter comment
87 | ERROR | [x] Separate the @param and @return sections by a blank line.
87 | ERROR | [ ] Description for the @return value is missing
91 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\src\Form\AbstractPermissionsCheckForm.php
----------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
----------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
9 | ERROR | [x] Missing class doc comment
11 | ERROR | [ ] Missing short description in doc comment
18 | ERROR | [ ] Missing short description in doc comment
29 | ERROR | [ ] Missing short description in doc comment
----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\src\Form\PermissionAbstractionDeleteForm.php
-------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
9 | ERROR | [x] Missing class doc comment
38 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\src\Form\PermissionAbstractionForm.php
-------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 4 WARNINGS AFFECTING 13 LINES
-------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
5 | WARNING | [x] Unused use statement
12 | ERROR | [x] Missing class doc comment
28 | ERROR | [ ] Missing short description in doc comment
36 | ERROR | [ ] Missing short description in doc comment
146 | ERROR | [x] Missing function doc comment
150 | ERROR | [ ] Missing short description in doc comment
156 | ERROR | [x] Expected 1 space(s) after cast statement; 0 found
179 | ERROR | [ ] Missing short description in doc comment
190 | ERROR | [x] Expected 1 space(s) after cast statement; 0 found
198 | WARNING | [x] A comma should follow the last multiline array item. Found: 'table'
204 | WARNING | [x] A comma should follow the last multiline array item. Found: 'table'
248 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
-------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\src\Form\PermissionAbstractionListBuilder.php
--------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
7 | WARNING | [x] Unused use statement
9 | ERROR | [x] Missing class doc comment
29 | ERROR | [ ] Missing short description in doc comment
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\src\Form\PermissionsForm.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 21 ERRORS AFFECTING 18 LINES
------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
8 | ERROR | [x] Missing class doc comment
22 | ERROR | [ ] Missing parameter comment
33 | ERROR | [ ] Parameter tags must be defined first in a doc comment
33 | ERROR | [ ] Missing parameter type
35 | ERROR | [ ] Missing parameter type
37 | ERROR | [ ] Missing parameter type
39 | ERROR | [x] Separate the @param and @return sections by a blank line.
39 | ERROR | [ ] Description for the @return value is missing
71 | ERROR | [ ] Variable "PermissionInfo" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
73 | ERROR | [ ] Variable "PermissionInfo" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
76 | ERROR | [ ] Variable "PermissionInfo" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
82 | ERROR | [ ] Variable "PermissionInfo" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
88 | ERROR | [ ] Variable "PermissionInfo" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
89 | ERROR | [ ] Variable "PermissionInfo" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
95 | ERROR | [ ] Variable "PermissionInfo" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
110 | ERROR | [ ] Missing short description in doc comment
111 | ERROR | [ ] Missing parameter comment
111 | ERROR | [ ] Missing parameter type
112 | ERROR | [ ] Description for the @return value is missing
122 | ERROR | [x] Missing function doc comment
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\src\Form\PermissionsFormInterface.php
------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 7 LINES
------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
5 | ERROR | [x] Missing interface doc comment
10 | ERROR | [ ] Missing parameter type
12 | ERROR | [ ] Missing parameter type
14 | ERROR | [ ] Missing parameter comment
14 | ERROR | [ ] Missing parameter type
16 | ERROR | [ ] Description for the @return value is missing
23 | ERROR | [ ] Missing parameter type
------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\src\FormAlter\PermissionsFormAlterBase.php
-----------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
-----------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
7 | ERROR | [x] Missing class doc comment
9 | ERROR | [x] Missing function doc comment
53 | ERROR | [x] Missing function doc comment
57 | ERROR | [x] Missing function doc comment
61 | ERROR | [x] Missing function doc comment
65 | ERROR | [x] Missing function doc comment
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\src\FormAlter\PermissionsFormMarkGoverned.php
--------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
5 | ERROR | [x] Missing class doc comment
7 | ERROR | [x] Missing function doc comment
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\src\FormAlter\PermissionsFormOnlyGoverned.php
--------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
5 | ERROR | [x] Missing class doc comment
7 | ERROR | [x] Missing function doc comment
11 | ERROR | [x] Missing function doc comment
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\src\FormAlter\PermissionsFormOnlyUngoverned.php
----------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
7 | ERROR | [x] Missing class doc comment
9 | ERROR | [x] Missing function doc comment
13 | ERROR | [x] Missing function doc comment
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\src\PermissionGovernor.php
-------------------------------------------------------------------------------------------------
FOUND 13 ERRORS AFFECTING 13 LINES
-------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
8 | ERROR | [x] Missing class doc comment
24 | ERROR | [ ] Missing short description in doc comment
25 | ERROR | [x] Data types in @var tags need to be fully namespaced
53 | ERROR | [ ] Missing parameter comment
54 | ERROR | [ ] Missing parameter comment
64 | ERROR | [ ] Missing parameter comment
79 | ERROR | [ ] Description for the @return value is missing
85 | ERROR | [ ] Missing short description in doc comment
86 | ERROR | [ ] Description for the @return value is missing
119 | ERROR | [ ] Missing short description in doc comment
120 | ERROR | [ ] Description for the @return value is missing
142 | ERROR | [x] Expected 1 space(s) after cast statement; 0 found
-------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\src\PermissionGraph.php
----------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
----------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
5 | ERROR | [x] Missing class doc comment
17 | ERROR | [ ] Missing parameter comment
19 | ERROR | [ ] Type hint "array" missing for $permissionAbstractions
30 | ERROR | [ ] Missing short description in doc comment
31 | ERROR | [ ] Description for the @return value is missing
34 | ERROR | [x] Use null coalesce operator instead of ternary operator.
----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\drupal-9\web\modules\contrib\abstractpermissions\tests\src\Functional\AdminPageTest.php
-------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
-------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇮🇳India anoopsingh92 Rajasthan, India

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India sahil.goyal

    There are a lot of coding standard issues/warning remained and addressed #4 attaching interdiff along with the patch.

  • 🇮🇳India sahil.goyal

    uploading to patch again by making few changes.

  • Status changed to Needs review almost 2 years ago
  • Status changed to Needs work 7 months ago
  • 🇮🇳India riddhi.addweb

    After applying the patch #6: "projects" > "features" > "list" returns an (almost) empty page there is one error still showing. Please review it. Attaching a Screenshot for the same.

    FILE: /var/www/html/web/drupal10/web/modules/contrib/abstractpermissions/src/Form/PermissionAbstractionForm.php
    ------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------
     10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Psr\Log\LoggerInterface.
    ------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------
    
Production build 0.71.5 2024