Fix the issues reported by phpcs

Created on 4 January 2023, over 1 year ago
Updated 23 June 2023, about 1 year ago

Problem/Motivation

Getting following error/warnings

FILE: /app/modules/contrib/quickedit/css/editors/image.theme.css
------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 3 LINES
------------------------------------------------------------------------
54 | ERROR | [x] Opening brace should be the last content on the line
54 | ERROR | [x] Closing brace of class definition must be on new line
55 | ERROR | [x] Opening brace should be the last content on the line
55 | ERROR | [x] Closing brace of class definition must be on new line
56 | ERROR | [x] Opening brace should be the last content on the line
56 | ERROR | [x] Closing brace of class definition must be on new line
------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/quickedit.api.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
26 | ERROR | Type hint "array" missing for &$editors
67 | ERROR | Return type missing for @return tag in function comment
----------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/quickedit.module
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
29 | ERROR | [ ] The array declaration extends to column 676 (the limit is 80). The array content should be split up over multiple lines
246 | ERROR | [x] Missing function doc comment
246 | ERROR | [ ] All functions defined in a module file must be prefixed with the module's name, found "layout_builder_quickedit_render_field" but expected
| | "quickedit_layout_builder_quickedit_render_field"
246 | ERROR | [x] Expected 1 blank line before function; 0 found
250 | ERROR | [x] Expected 1 blank line after function; 0 found
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/src/Ajax/EntitySavedCommand.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
9 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
-----------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/src/Ajax/FieldFormCommand.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
9 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
-----------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/src/Ajax/FieldFormSavedCommand.php
------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------
10 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
19 | ERROR | Class property $other_view_modes should use lowerCamel naming without underscores
30 | ERROR | Type hint "array" missing for $other_view_modes
------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/src/Ajax/FieldFormValidationErrorsCommand.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
9 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
-----------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/src/Annotation/InPlaceEditor.php
---------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
---------------------------------------------------------------------------
10 | ERROR | [x] Doc comment long description must end with a full stop
12 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/src/Controller/QuickEditImageController.php
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
-------------------------------------------------------------------------------------------------------------------------------------------
101 | ERROR | [x] Parameter comment must end with a full stop
118 | ERROR | [ ] The array declaration extends to column 130 (the limit is 80). The array content should be split up over multiple lines
123 | ERROR | [ ] The array declaration extends to column 123 (the limit is 80). The array content should be split up over multiple lines
168 | ERROR | [ ] The array declaration extends to column 136 (the limit is 80). The array content should be split up over multiple lines
178 | ERROR | [x] Parameter comment must end with a full stop
209 | ERROR | [x] Parameter comment must end with a full stop
-------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/src/LayoutBuilderIntegration.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
279 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/src/Plugin/InPlaceEditor/Editor.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------------
60 | ERROR | Description for the @return value is missing
64 | ERROR | The array declaration extends to column 130 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/src/Plugin/InPlaceEditorInterface.php
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
32 | WARNING | Line exceeds 80 characters; contains 84 characters
--------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/src/QuickEditController.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
340 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
340 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/tests/src/Functional/EditorIntegrationLoadingTest.php
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------------------------------------------------
34 | ERROR | [ ] The array declaration extends to column 143 (the limit is 80). The array content should be split up over multiple lines
36 | ERROR | [x] Missing function doc comment
123 | ERROR | [ ] The array declaration extends to column 130 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/tests/src/Functional/QuickEditCustomPipelineTest.php
-----------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
-----------------------------------------------------------------------------------------
66 | WARNING | [x] There must be no blank line following an inline comment
66 | WARNING | [ ] There must be no blank line following an inline comment
-----------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/tests/src/Functional/Rest/QuickEditLayoutBuilderEntityViewDisplayJsonAnonTest.php
----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------
7 | ERROR | Missing short description in doc comment
----------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/tests/src/Functional/Rest/QuickEditLayoutBuilderEntityViewDisplayJsonBasicAuthTest.php
---------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------
7 | ERROR | Missing short description in doc comment
---------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/tests/src/Functional/Rest/QuickEditLayoutBuilderEntityViewDisplayJsonCookieTest.php
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
7 | ERROR | Missing short description in doc comment
------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/tests/src/Functional/Rest/QuickEditLayoutBuilderEntityViewDisplayXmlAnonTest.php
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------
7 | ERROR | Missing short description in doc comment
---------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/tests/src/Functional/Rest/QuickEditLayoutBuilderEntityViewDisplayXmlBasicAuthTest.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------
7 | ERROR | Missing short description in doc comment
--------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/tests/src/Functional/Rest/QuickEditLayoutBuilderEntityViewDisplayXmlCookieTest.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------
7 | ERROR | Missing short description in doc comment
-----------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/tests/src/FunctionalJavascript/CKEditor5IntegrationTest.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------
117 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
199 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/tests/src/FunctionalJavascript/LayoutBuilderIntegrationTest.php
----------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------
14 | ERROR | Missing short description in doc comment
----------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/tests/src/FunctionalJavascript/QuickEditFileTest.php
-----------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------
11 | ERROR | Missing short description in doc comment
-----------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/tests/src/FunctionalJavascript/QuickEditImageEditorTestTrait.php
-----------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------
5 | ERROR | Missing short description in doc comment
-----------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/tests/src/FunctionalJavascript/QuickEditJavascriptTestBase.php
---------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------------
25 | ERROR | [ ] Missing member variable doc comment
82 | WARNING | [x] There must be no blank line following an inline comment
82 | WARNING | [ ] There must be no blank line following an inline comment
257 | ERROR | [ ] Type hint "array" missing for $expected_field_attributes
---------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/tests/src/FunctionalJavascript/QuickEditLoadingTest.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------------
19 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
110 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
252 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
266 | 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: /app/modules/contrib/quickedit/tests/src/Kernel/EditorIntegrationTest.php
-------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------
66 | ERROR | [x] Missing function doc comment
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
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/tests/src/Kernel/EditorSelectionTest.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------------------------------------
29 | ERROR | [x] Missing function doc comment
75 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
85 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
112 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/tests/src/Kernel/MetadataGeneratorTest.php
-------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------
51 | ERROR | [x] Missing function doc comment
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/tests/src/Kernel/QuickEditLoadingTest.php
------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------
13 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
70 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/tests/src/Kernel/QuickEditTestBase.php
----------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------------------
35 | ERROR | [x] Doc comment long description must end with a full stop
39 | ERROR | [ ] The @var tag must be the first tag in a member variable comment
78 | ERROR | [ ] Type hint "array" missing for $field_settings
78 | ERROR | [ ] Type hint "array" missing for $widget_settings
78 | ERROR | [ ] Type hint "array" missing for $formatter_settings
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------

FILE: /app/modules/contrib/quickedit/tests/src/Unit/Access/QuickEditEntityFieldAccessCheckTest.php
--------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------
126 | ERROR | Description for the @return value is missing
--------------------------------------------------------------------------------------------------

Time: 1.95 secs; Memory: 14MB

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/quickedit/

Proposed resolution

Above error/warnings need to be fixed

📌 Task
Status

Needs work

Version

1.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

Not all content is available!

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

Production build 0.69.0 2024