Fix issues reported by phpcs.

Created on 13 June 2023, over 1 year ago
Updated 20 June 2023, over 1 year ago

Problem/Motivation

FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/entity_clone/entity_clone.module
---------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------
164 | ERROR | [x] Concat operator must be surrounded by a single space
---------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------

FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/entity_clone/src/Form/EntityCloneForm.php
------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------
213 | ERROR | [x] Expected 1 space after "="; 0 found
266 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 7
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------

FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/entity_clone/src/Plugin/Derivative/EntityCloneContextualLinks.php
------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------
12 | ERROR | [x] Doc comment short description must end with a full stop
15 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
37 | ERROR | [ ] Missing parameter comment
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------

FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/entity_clone/tests/src/Functional/EntityCloneCloneableEntitiesConfigTest.php
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
-----------------------------------------------------------------------------------------------------------------------------------
22 | ERROR | [x] Doc comment short description must end with a full stop
23 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
52 | WARNING | [x] A comma should follow the last multiline array item. Found: 'view unpublished paragraphs'
97 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
98 | ERROR | [x] Array closing indentation error, expected 4 spaces but found 6
-----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------

FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/entity_clone/README.md
-----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------
49 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------

FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/entity_clone/entity_clone.api.php
----------------------------------------------------------------------------------------
FOUND 1 ERROR AND 5 WARNINGS AFFECTING 5 LINES
----------------------------------------------------------------------------------------
36 | ERROR | Class name doesn't match filename; expected "class entity_clone.api"
36 | WARNING | Class name must be prefixed with the project name "EntityClone"
46 | WARNING | Unused variable $original.
47 | WARNING | Unused variable $newEntity.
58 | WARNING | Unused variable $original.
59 | WARNING | Unused variable $newEntity.
----------------------------------------------------------------------------------------

FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/entity_clone/modules/entity_clone_extras/entity_clone_extras.module
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
71 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "_entity_clone_extra_supported_entity_types" but expected "entity_clone_extras__entity_clone_extra_supported_entity_types"
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run the phpcs command inside module folder.
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig .

Proposed resolution

Work on fixing the issues create a patch and get it reviewed.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇳India arpitk

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

Production build 0.71.5 2024