Fix the issues reported by phpcs

Created on 21 February 2024, 9 months ago
Updated 17 April 2024, 7 months ago

Problem/Motivation

There is a files need to fixed with coding standards.
Here is the command : -
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,twig modules/contrib/entity_holder/

Result :-

FILE: /home/prem/Documents/drupal11/modules/custom/entity_holder/src/EntityHolderStorage.php
---------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------------------
  7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\EntityTypeInterface.
 27 | ERROR | [ ] Parameter $entity_type is not described in comment
 27 | ERROR | [ ] Parameter $config_factory is not described in comment
 27 | ERROR | [ ] Parameter $uuid_service is not described in comment
 27 | ERROR | [ ] Parameter $language_manager is not described in comment
 27 | ERROR | [ ] Parameter $memory_cache is not described in comment
---------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------


FILE: /home/prem/Documents/drupal11/modules/custom/entity_holder/src/Form/EntityHolderForm.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------
  96 | WARNING | Unused variable $entity_type_bundle.
 206 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------


FILE: /home/prem/Documents/drupal11/modules/custom/entity_holder/src/Controller/EntityHolderController.php
----------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AND 1 WARNING AFFECTING 5 LINES
----------------------------------------------------------------------------------------------------------
  44 | ERROR   | [ ] Parameter $http_kernel is not described in comment
  44 | ERROR   | [ ] Parameter $renderer is not described in comment
 109 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 113 | ERROR   | [ ] Missing short description in doc comment
 115 | ERROR   | [ ] Missing parameter comment
 117 | ERROR   | [ ] Description for the @return value is missing
----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------

Steps to reproduce

Run PHPCS on entity_holder module.

Proposed resolution

Fixed the coding standards.

Remaining tasks

Submit the patch either MR .

๐Ÿ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024