Fix the issues reported by phpcs

Created on 16 February 2023, almost 2 years ago
Updated 26 August 2024, 4 months ago

Problem/Motivation

Getting following error/warnings.

FILE: .../contrib/layoutbuilder_extras-3342225/src/LayoutBuilderElementOverride.php
--------------------------------------------------------------------------------
FOUND 8 ERRORS AND 2 WARNINGS AFFECTING 10 LINES
--------------------------------------------------------------------------------
9 | WARNING | [x] Unused use statement
12 | ERROR | [x] Doc comment short description must end with a full stop
18 | ERROR | [x] Missing function doc comment
38 | ERROR | [x] Expected newline after closing brace
45 | ERROR | [x] Expected newline after closing brace
49 | WARNING | [ ] Unused variable $key.
63 | ERROR | [ ] Concatenating translatable strings is not allowed, use
| | placeholders instead and only one string literal
66 | ERROR | [x] Data types in @var tags need to be fully namespaced
70 | ERROR | [ ] The array declaration extends to column 99 (the limit is
| | 80). The array content should be split up over multiple
| | lines
107 | ERROR | [x] Expected 1 space after "??"; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...les/contrib/layoutbuilder_extras-3342225/src/LayoutBuilderExtrasLayout.php
--------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 6 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
2 | ERROR | [x] Namespaced classes, interfaces and traits should not begin
| | with a file doc comment
17 | ERROR | [x] Missing class doc comment
26 | ERROR | [x] You must use "/**" style comments for a member variable
| | comment
57 | ERROR | [ ] Missing parameter comment
57 | ERROR | [ ] Missing parameter type
59 | ERROR | [ ] Description for the @return value is missing
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...ras-3342225/src/Controller/LayoutBuilderExtrasSectionActionsController.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
46 | ERROR | Parameter $extension_list_module is not described in comment
87 | ERROR | No key specified for array entry; first entry specifies key
94 | ERROR | No key specified for array entry; first entry specifies key
--------------------------------------------------------------------------------

FILE: ...rib/layoutbuilder_extras-3342225/src/Controller/AlterSectionController.php
--------------------------------------------------------------------------------
FOUND 24 ERRORS AND 1 WARNING AFFECTING 19 LINES
--------------------------------------------------------------------------------
33 | ERROR | [x] The open comment tag must be the only content on the line
33 | ERROR | [ ] Missing short description in doc comment
33 | ERROR | [x] Expected "integerDelta" but found "integer Delta " for
| | @var tag in member variable comment
36 | ERROR | [x] The open comment tag must be the only content on the line
36 | ERROR | [ ] Missing short description in doc comment
36 | ERROR | [x] Expected "stringpluginIDofthelayout" but found "string
| | plugin ID of the layout " for @var tag in member variable
| | comment
37 | ERROR | [ ] Class property $plugin_id should use lowerCamel naming
| | without underscores
39 | ERROR | [ ] Missing short description in doc comment
40 | ERROR | [x] Data types in @var tags need to be fully namespaced
42 | ERROR | [ ] Class property $form_builder should use lowerCamel naming
| | without underscores
47 | ERROR | [x] Data types in @param tags need to be fully namespaced
61 | ERROR | [x] Expected 1 blank line after function; 2 found
64 | ERROR | [ ] Parameter $plugin_id is not described in comment
65 | ERROR | [x] Doc comment short description must end with a full stop
91 | ERROR | [x] Missing function doc comment
93 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
114 | ERROR | [ ] Missing parameter comment
116 | ERROR | [ ] Type hint "\Drupal\layout_builder\Section" missing for
| | $section
130 | ERROR | [x] Expected 1 blank line after function; 2 found
136 | ERROR | [ ] Missing parameter comment
136 | ERROR | [ ] Missing parameter type
138 | ERROR | [ ] Description for the @return value is missing
153 | ERROR | [ ] Missing parameter comment
153 | ERROR | [ ] Missing parameter type
155 | ERROR | [ ] Private method name
| | "AlterSectionController::alterAjaxSubmitURL" is not in
| | lowerCamel format
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: .../layoutbuilder_extras-3342225/src/Form/LayoutBuilderExtrasSettingsForm.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
94 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced
| | with use statements
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...uilder_extras-3342225/src/Form/LayoutBuilderExtrasConfigureSectionForm.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
9 | WARNING | The class short comment should describe what the class does and
| | not simply repeat the class name
--------------------------------------------------------------------------------

FILE: ...es/contrib/layoutbuilder_extras-3342225/src/Menu/ContextualLinkManager.php
--------------------------------------------------------------------------------
FOUND 24 ERRORS AFFECTING 9 LINES
--------------------------------------------------------------------------------
18 | ERROR | [ ] Namespaced classes/interfaces/traits should be referenced
| | with use statements
27 | ERROR | [x] The open comment tag must be the only content on the line
27 | ERROR | [ ] Missing short description in doc comment
27 | ERROR | [x] Data types in @var tags need to be fully namespaced
27 | ERROR | [x] Expected "ConfigFactoryInterface" but found
| | "ConfigFactoryInterface " for @var tag in member variable
| | comment
30 | ERROR | [ ] Missing member variable doc comment
31 | ERROR | [ ] Missing member variable doc comment
52 | ERROR | [x] Data types in @param tags need to be fully namespaced
55 | ERROR | [ ] Namespaced classes/interfaces/traits should be referenced
| | with use statements
56 | ERROR | [x] There should be no white space after an opening "("
56 | ERROR | [x] Expected 1 space after comma in argument list; 2 found
56 | ERROR | [x] Expected one space after the comma, 2 found
56 | ERROR | [x] Expected 1 space after comma in argument list; 2 found
56 | ERROR | [x] Expected one space after the comma, 2 found
56 | ERROR | [x] Expected 1 space after comma in argument list; 2 found
56 | ERROR | [x] Expected one space after the comma, 2 found
56 | ERROR | [x] Expected 1 space after comma in argument list; 2 found
56 | ERROR | [x] Expected one space after the comma, 2 found
56 | ERROR | [x] Expected 1 space after comma in argument list; 2 found
56 | ERROR | [x] Expected one space after the comma, 2 found
56 | ERROR | [x] Expected 1 space after comma in argument list; 2 found
56 | ERROR | [x] Expected one space after the comma, 2 found
74 | ERROR | [x] Expected 1 space after IF keyword; 2 found
127 | ERROR | [x] Expected newline after closing brace
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 19 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...eb/modules/contrib/layoutbuilder_extras-3342225/assets/js/hide_lb_admin.js
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
13 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
37 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 2 empty lines
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...trib/layoutbuilder_extras-3342225/assets/css/admin_section_actions_top.css
--------------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 9 LINES
--------------------------------------------------------------------------------
2 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
3 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
4 | ERROR | [x] Blank lines are not allowed in class definitions
5 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
6 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
7 | ERROR | [x] Blank lines are not allowed in class definitions
8 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
12 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
13 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: .../contrib/layoutbuilder_extras-3342225/assets/css/admin_section_library.css
--------------------------------------------------------------------------------
FOUND 20 ERRORS AFFECTING 20 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] Additional whitespace found at start of file
43 | ERROR | [x] Blank lines are not allowed in class definitions
46 | ERROR | [x] Blank lines are not allowed in class definitions
50 | ERROR | [x] Blank lines are not allowed in class definitions
62 | ERROR | [x] Blank lines are not allowed in class definitions
64 | ERROR | [x] Blank lines are not allowed in class definitions
81 | ERROR | [x] Blank lines are not allowed in class definitions
84 | ERROR | [x] Blank lines are not allowed in class definitions
92 | ERROR | [x] Blank lines are not allowed in class definitions
148 | ERROR | [x] Blank lines are not allowed in class definitions
152 | ERROR | [x] Blank lines are not allowed in class definitions
194 | ERROR | [x] Blank lines are not allowed in class definitions
196 | ERROR | [x] Blank lines are not allowed in class definitions
201 | ERROR | [x] Blank lines are not allowed in class definitions
209 | ERROR | [x] Blank lines are not allowed in class definitions
211 | ERROR | [x] Blank lines are not allowed in class definitions
231 | ERROR | [x] Blank lines are not allowed in class definitions
233 | ERROR | [x] Blank lines are not allowed in class definitions
236 | ERROR | [x] Blank lines are not allowed in class definitions
244 | ERROR | [x] Blank lines are not allowed in class definitions
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 20 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...rib/layoutbuilder_extras-3342225/assets/css/admin_section_actions_left.css
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
2 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
3 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
7 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...al10/web/modules/contrib/layoutbuilder_extras-3342225/assets/css/admin.css
--------------------------------------------------------------------------------
FOUND 13 ERRORS AFFECTING 13 LINES
--------------------------------------------------------------------------------
29 | ERROR | [x] Blank lines are not allowed in class definitions
32 | ERROR | [x] Blank lines are not allowed in class definitions
36 | ERROR | [x] Blank lines are not allowed in class definitions
48 | ERROR | [x] Blank lines are not allowed in class definitions
50 | ERROR | [x] Blank lines are not allowed in class definitions
65 | ERROR | [x] Blank lines are not allowed in class definitions
68 | ERROR | [x] Blank lines are not allowed in class definitions
77 | ERROR | [x] Blank lines are not allowed in class definitions
147 | ERROR | [x] Blank lines are not allowed in class definitions
154 | ERROR | [x] Blank lines are not allowed in class definitions
157 | ERROR | [x] Blank lines are not allowed in class definitions
172 | ERROR | [x] Blank lines are not allowed in class definitions
180 | ERROR | [x] Blank lines are not allowed in class definitions
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...b/modules/contrib/layoutbuilder_extras-3342225/layoutbuilder_extras.module
--------------------------------------------------------------------------------
FOUND 8 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
--------------------------------------------------------------------------------
10 | WARNING | [x] Unused use statement
37 | WARNING | [ ] Unused variable $lbField.
133 | WARNING | [x] There must be no blank line following an inline comment
133 | WARNING | [ ] There must be no blank line following an inline comment
133 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
218 | WARNING | [ ] Hook implementations should not duplicate @param
| | documentation
218 | ERROR | [ ] Missing parameter comment
222 | ERROR | [ ] The array declaration extends to column 91 (the limit is
| | 80). The array content should be split up over multiple
| | lines
222 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced
| | with use statements
230 | WARNING | [ ] Hook implementations should not duplicate @param
| | documentation
230 | ERROR | [ ] Missing parameter comment
230 | ERROR | [ ] Missing parameter type
231 | WARNING | [ ] Hook implementations should not duplicate @param
| | documentation
231 | ERROR | [ ] Missing parameter comment
231 | ERROR | [ ] Missing parameter type
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 1.25 secs; Memory: 10MB

Steps to reproduce

Run following command

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

Proposed resolution

Above error/warnings need to be fixed.

📌 Task
Status

Needs work

Version

2.0

Component

Code

Created by

🇮🇳India samit.310@gmail.com

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

  • Issue created by @samit.310@gmail.com
  • 🇮🇳India samit.310@gmail.com

    Problem/Motivation

    Getting following error/warnings.

    PHPCBF RESULT SUMMARY
    --------------------------------------------------------------------------------------------------------------------
    FILE FIXED REMAINING
    --------------------------------------------------------------------------------------------------------------------
    /var/www/html/modules/contrib/layoutbuilder_extras/layoutbuilder_extras.module 5 9
    /var/www/html/modules/contrib/layoutbuilder_extras/assets/css/admin_section_actions_left.css 3 0
    /var/www/html/modules/contrib/layoutbuilder_extras/assets/css/admin_section_library.css 19 0
    /var/www/html/modules/contrib/layoutbuilder_extras/assets/css/admin.css 13 0
    /var/www/html/modules/contrib/layoutbuilder_extras/assets/css/admin_section_actions_top.css 9 0
    /var/www/html/modules/contrib/layoutbuilder_extras/src/LayoutBuilderExtrasLayout.php 4 5
    /var/www/html/modules/contrib/layoutbuilder_extras/src/Form/LayoutBuilderExtrasSettingsForm.php 1 1
    /var/www/html/modules/contrib/layoutbuilder_extras/src/Controller/AlterSectionController.php 11 15
    /var/www/html/modules/contrib/layoutbuilder_extras/src/LayoutBuilderElementOverride.php 7 4
    /var/www/html/modules/contrib/layoutbuilder_extras/src/Menu/ContextualLinkManager.php 19 5
    --------------------------------------------------------------------------------------------------------------------
    A TOTAL OF 91 ERRORS WERE FIXED IN 10 FILES
    --------------------------------------------------------------------------------------------------------------------

    Time: 1.93 secs; Memory: 6MB

    samit.khulve@Drupal-contrib-web:/var/www/html$ phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,prfile,theme,css,info,txt,md,yml modules/contrib/layoutbuilder_extras/

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/layoutbuilder_extras.module
    ------------------------------------------------------------------------------------
    FOUND 5 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    ------------------------------------------------------------------------------------
    38 | WARNING | Unused variable $lbField.
    227 | WARNING | Hook implementations should not duplicate @param documentation
    227 | ERROR | Missing parameter comment
    239 | WARNING | Hook implementations should not duplicate @param documentation
    239 | ERROR | Missing parameter comment
    239 | ERROR | Missing parameter type
    240 | WARNING | Hook implementations should not duplicate @param documentation
    240 | ERROR | Missing parameter comment
    240 | ERROR | Missing parameter type
    ------------------------------------------------------------------------------------

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/src/LayoutBuilderExtrasLayout.php
    ------------------------------------------------------------------------------------------
    FOUND 5 ERRORS AFFECTING 4 LINES
    ------------------------------------------------------------------------------------------
    14 | ERROR | Doc comment is empty
    25 | ERROR | Missing short description in doc comment
    60 | ERROR | Missing parameter comment
    60 | ERROR | Missing parameter type
    62 | ERROR | Description for the @return value is missing
    ------------------------------------------------------------------------------------------

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/src/Form/LayoutBuilderExtrasSettingsForm.php
    ---------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------
    109 | WARNING | Role::loadMultiple calls should be avoided in classes, use dependency injection instead
    ---------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/src/Form/LayoutBuilderExtrasConfigureSectionForm.php
    ----------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------
    9 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
    ----------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/src/Controller/LayoutBuilderExtrasSectionActionsController.php
    -----------------------------------------------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    -----------------------------------------------------------------------------------------------------------------------
    46 | ERROR | Parameter $extension_list_module is not described in comment
    87 | ERROR | No key specified for array entry; first entry specifies key
    94 | ERROR | No key specified for array entry; first entry specifies key
    -----------------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/src/Controller/AlterSectionController.php
    ------------------------------------------------------------------------------------------------------------
    FOUND 15 ERRORS AFFECTING 13 LINES
    ------------------------------------------------------------------------------------------------------------
    33 | ERROR | Missing short description in doc comment
    37 | ERROR | Missing short description in doc comment
    39 | ERROR | Class property $plugin_id should use lowerCamel naming without underscores
    41 | ERROR | Missing short description in doc comment
    44 | ERROR | Class property $form_builder should use lowerCamel naming without underscores
    65 | ERROR | Parameter $plugin_id is not described in comment
    92 | ERROR | Doc comment is empty
    118 | ERROR | Missing parameter comment
    120 | ERROR | Type hint "\Drupal\layout_builder\Section" missing for $section
    139 | ERROR | Missing parameter comment
    139 | ERROR | Missing parameter type
    141 | ERROR | Description for the @return value is missing
    156 | ERROR | Missing parameter comment
    156 | ERROR | Missing parameter type
    158 | ERROR | Private method name "AlterSectionController::alterAjaxSubmitURL" is not in lowerCamel format
    ------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/src/LayoutBuilderElementOverride.php
    ---------------------------------------------------------------------------------------------------------------------------------------
    FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
    ---------------------------------------------------------------------------------------------------------------------------------------
    17 | ERROR | Doc comment is empty
    53 | WARNING | Unused variable $key.
    67 | ERROR | Concatenating translatable strings is not allowed, use placeholders instead and only one string literal
    74 | ERROR | The array declaration extends to column 99 (the limit is 80). The array content should be split up over multiple lines
    ---------------------------------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/src/Menu/ContextualLinkManager.php
    --------------------------------------------------------------------------------------------
    FOUND 5 ERRORS AFFECTING 5 LINES
    --------------------------------------------------------------------------------------------
    18 | ERROR | Namespaced classes/interfaces/traits should be referenced with use statements
    27 | ERROR | Missing short description in doc comment
    31 | ERROR | Missing member variable doc comment
    32 | ERROR | Missing member variable doc comment
    56 | ERROR | Namespaced classes/interfaces/traits should be referenced with use statements
    --------------------------------------------------------------------------------------------

    Time: 2.01 secs; Memory: 6MB

    samit.khulve@Drupal-contrib-web:/var/www/html$ phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,prfile,theme,css,info,txt,md,yml modules/contrib/layoutbuilder_extras/

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/layoutbuilder_extras.module
    ------------------------------------------------------------------------------------
    FOUND 5 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    ------------------------------------------------------------------------------------
    38 | WARNING | Unused variable $lbField.
    227 | WARNING | Hook implementations should not duplicate @param documentation
    227 | ERROR | Missing parameter comment
    239 | WARNING | Hook implementations should not duplicate @param documentation
    239 | ERROR | Missing parameter comment
    239 | ERROR | Missing parameter type
    240 | WARNING | Hook implementations should not duplicate @param documentation
    240 | ERROR | Missing parameter comment
    240 | ERROR | Missing parameter type
    ------------------------------------------------------------------------------------

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/src/LayoutBuilderExtrasLayout.php
    ------------------------------------------------------------------------------------------
    FOUND 5 ERRORS AFFECTING 4 LINES
    ------------------------------------------------------------------------------------------
    14 | ERROR | Doc comment is empty
    25 | ERROR | Missing short description in doc comment
    60 | ERROR | Missing parameter comment
    60 | ERROR | Missing parameter type
    62 | ERROR | Description for the @return value is missing
    ------------------------------------------------------------------------------------------

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/src/Form/LayoutBuilderExtrasSettingsForm.php
    ---------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------
    109 | WARNING | Role::loadMultiple calls should be avoided in classes, use dependency injection instead
    ---------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/src/Form/LayoutBuilderExtrasConfigureSectionForm.php
    ----------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------
    9 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
    ----------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/src/Controller/LayoutBuilderExtrasSectionActionsController.php
    -----------------------------------------------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    -----------------------------------------------------------------------------------------------------------------------
    46 | ERROR | Parameter $extension_list_module is not described in comment
    87 | ERROR | No key specified for array entry; first entry specifies key
    94 | ERROR | No key specified for array entry; first entry specifies key
    -----------------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/src/Controller/AlterSectionController.php
    ------------------------------------------------------------------------------------------------------------
    FOUND 15 ERRORS AFFECTING 13 LINES
    ------------------------------------------------------------------------------------------------------------
    33 | ERROR | Missing short description in doc comment
    37 | ERROR | Missing short description in doc comment
    39 | ERROR | Class property $plugin_id should use lowerCamel naming without underscores
    41 | ERROR | Missing short description in doc comment
    44 | ERROR | Class property $form_builder should use lowerCamel naming without underscores
    65 | ERROR | Parameter $plugin_id is not described in comment
    92 | ERROR | Doc comment is empty
    118 | ERROR | Missing parameter comment
    120 | ERROR | Type hint "\Drupal\layout_builder\Section" missing for $section
    139 | ERROR | Missing parameter comment
    139 | ERROR | Missing parameter type
    141 | ERROR | Description for the @return value is missing
    156 | ERROR | Missing parameter comment
    156 | ERROR | Missing parameter type
    158 | ERROR | Private method name "AlterSectionController::alterAjaxSubmitURL" is not in lowerCamel format
    ------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/src/LayoutBuilderElementOverride.php
    ---------------------------------------------------------------------------------------------------------------------------------------
    FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
    ---------------------------------------------------------------------------------------------------------------------------------------
    17 | ERROR | Doc comment is empty
    53 | WARNING | Unused variable $key.
    67 | ERROR | Concatenating translatable strings is not allowed, use placeholders instead and only one string literal
    74 | ERROR | The array declaration extends to column 99 (the limit is 80). The array content should be split up over multiple lines
    ---------------------------------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/src/Menu/ContextualLinkManager.php
    --------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------
    71 | ERROR | Namespaced classes/interfaces/traits should be referenced with use statements
    --------------------------------------------------------------------------------------------

    Time: 1.64 secs; Memory: 6MB

    samit.khulve@Drupal-contrib-web:/var/www/html$ phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,prfile,theme,css,info,txt,md,yml modules/contrib/layoutbuilder_extras/

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/layoutbuilder_extras.module
    ------------------------------------------------------------------------------------
    FOUND 5 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    ------------------------------------------------------------------------------------
    38 | WARNING | Unused variable $lbField.
    227 | WARNING | Hook implementations should not duplicate @param documentation
    227 | ERROR | Missing parameter comment
    239 | WARNING | Hook implementations should not duplicate @param documentation
    239 | ERROR | Missing parameter comment
    239 | ERROR | Missing parameter type
    240 | WARNING | Hook implementations should not duplicate @param documentation
    240 | ERROR | Missing parameter comment
    240 | ERROR | Missing parameter type
    ------------------------------------------------------------------------------------

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/src/LayoutBuilderExtrasLayout.php
    ------------------------------------------------------------------------------------------
    FOUND 5 ERRORS AFFECTING 4 LINES
    ------------------------------------------------------------------------------------------
    14 | ERROR | Doc comment is empty
    25 | ERROR | Missing short description in doc comment
    60 | ERROR | Missing parameter comment
    60 | ERROR | Missing parameter type
    62 | ERROR | Description for the @return value is missing
    ------------------------------------------------------------------------------------------

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/src/Form/LayoutBuilderExtrasSettingsForm.php
    ---------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------
    109 | WARNING | Role::loadMultiple calls should be avoided in classes, use dependency injection instead
    ---------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/src/Form/LayoutBuilderExtrasConfigureSectionForm.php
    ----------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------
    9 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
    ----------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/src/Controller/LayoutBuilderExtrasSectionActionsController.php
    -----------------------------------------------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    -----------------------------------------------------------------------------------------------------------------------
    46 | ERROR | Parameter $extension_list_module is not described in comment
    87 | ERROR | No key specified for array entry; first entry specifies key
    94 | ERROR | No key specified for array entry; first entry specifies key
    -----------------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/modules/contrib/layoutbuilder_extras/src/Controller/AlterSectionController.php
    ------------------------------------------------------------------------------------------------------------
    FOUND 15 ERRORS AFFECTING 13 LINES
    ------------------------------------------------------------------------------------------------------------
    33 | ERROR | Missing short description in doc comment
    37 | ERROR | Missing short description in doc comment
    39 | ERROR | Class property $plugin_id should use lowerCamel naming without underscores
    41 | ERROR | Missing short description in doc comment
    44 | ERROR | Class property $form_builder should use lowerCamel naming without underscores
    65 | ERROR | Parameter $plugin_id is not described in comment
    92 | ERROR | Doc comment is empty
    118 | ERROR | Missing parameter comment
    120 | ERROR | Type hint "\Drupal\layout_builder\Section" missing for $section
    139 | ERROR | Missing parameter comment
    139 | ERROR | Missing parameter type
    141 | ERROR | Description for the @return value is missing
    156 | ERROR | Missing parameter comment
    156 | ERROR | Missing parameter type
    158 | ERROR | Private method name "AlterSectionController::alterAjaxSubmitURL" is not in lowerCamel format
    ------------------------------------------------------------------------------------------------------------

    Time: 1.36 secs; Memory: 6MB

    Steps to reproduce

    Run following command

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

    Proposed resolution

    Above error/warnings need to be fixed.

  • First commit to issue fork.
  • Issue was unassigned.
  • 🇮🇳India urvashi_vora Madhya Pradesh, India
  • Status changed to Active over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    Since there are not MRs nor patches, the status is still Active.

  • 🇮🇳India urvashi_vora Madhya Pradesh, India

    Updating Issue summary based on changes reflected after latest pull.

  • Assigned to urvashi_vora
  • Status changed to Needs work over 1 year ago
  • 🇮🇳India urvashi_vora Madhya Pradesh, India

    I am working on this.

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India urvashi_vora Madhya Pradesh, India

    Resolved all errors except:

    FILE: ...tras-3342225/src/Controller/LayoutBuilderExtrasSectionActionsController.php
    ---------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    ---------------------------------------------------------------------------------
    89 | ERROR | No key specified for array entry; first entry specifies key
    96 | ERROR | No key specified for array entry; first entry specifies key
    ---------------------------------------------------------------------------------

    FILE: ...les/contrib/layoutbuilder_extras-3342225/src/Menu/ContextualLinkManager.php
    ---------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    ---------------------------------------------------------------------------------
    18 | ERROR | Namespaced classes/interfaces/traits should be referenced with use
    | | statements
    70 | ERROR | Namespaced classes/interfaces/traits should be referenced with use
    | | statements
    ---------------------------------------------------------------------------------

    Time: 1.14 secs; Memory: 10MB

    Sending a PR shortly.

  • @urvashi_vora opened merge request.
  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    +/**
    + * Implements class LayoutBuilderExtrasLayout.
    + */
     class LayoutBuilderExtrasLayout extends LayoutDefault {
     

    A documentation comment for a class must not start with Implements, nor repeat the class name.

    +  /**
    +   * Layout Plugin Manager.
    +   *
    +   * @var \Drupal\Core\Layout\LayoutPluginManager
    +   */
    +
       private $layoutManager;
    

    The description is missing an article and contains capitalized words that should not be capitalized.
    Between the comment and the property definition there must not be empty lines.

    +   * Constructs Object.
    +   *
    +   * @param array $configuration
    +   *   Configuration.
    +   * @param string $plugin_id
    +   *   Plugin Id.
    +   * @param string $plugin_definition
    +   *   Plugin Definition.
        */
       public function __construct(array $configuration, $plugin_id, $plugin_definition) {

    The short description for a constructor starts with Constructs a new followed by the class name (namespaces included) and ends with object.
    The parameter descriptions are each missing an article.
    Id is misspelled like the words that follow the first word in each description.

        * @return array
    +   *   Return statement.
        */
       private function getLayouts($currentLayout) {

    That does not describe what the method returns.
    The description for the return value must not start with Return.

    +  /**
    +   * Boolean is Admin.
    +   *
    +   * @var bool
    +   */
       private $isAdmin = TRUE;
    +
    +  /**
    +   * Boolean is LB Path.
    +   *
    +   * @var bool
    +   */
       private $isLBPath = TRUE;

    Those descriptions do not make sense and they do not describe the properties.

  • Assigned to tim-diels
  • 🇧🇪Belgium tim-diels Belgium 🇧🇪

    We'll pick this up at DrupalCon Lille. So please don't work on this yet.

  • Issue was unassigned.
  • 🇧🇪Belgium tim-diels Belgium 🇧🇪
  • 🇧🇪Belgium mschudders

    @tim shall I resolve these?

    Cheers

  • 🇧🇪Belgium tim-diels Belgium 🇧🇪

    Go ahead. We didn’t had the time to pick it up.

Production build 0.71.5 2024