- 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.
- Status changed to Active
over 1 year ago 1:25pm 2 May 2023 - 🇮🇹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 3:19am 3 May 2023 - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 5:17am 3 May 2023 - 🇮🇳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 7:35pm 3 May 2023 - 🇮🇹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 🇧🇪
Go ahead. We didn’t had the time to pick it up.