Fix the issues reported by phpcs

Created on 18 July 2024, about 2 months ago

Problem/Motivation

There is a file that needs to be fixed with coding standards.
Here is the command: -

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml .

FILE: D:\wamp64\www\demo8\modules\custom\madness\madness.info.yml
-------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
 1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | "core_version_requirement" property is missing in the info.yml file
-------------------------------------------------------------------------------------------------------------


FILE: D:\wamp64\www\demo8\modules\custom\madness\src\Commands\MadnessCommands.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\user\Entity\User.
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------


FILE: D:\wamp64\www\demo8\modules\custom\madness\src\MadnessEventSubscriber.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------
  9 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Logger\LoggerChannelFactory.
 15 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------


FILE: D:\wamp64\www\demo8\modules\custom\madness\src\MadnessLevels.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
 11 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
 35 | WARNING | [x] '@TODO Update block cache.' should match the format '@todo Fix problem X here.'
 41 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 45 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 53 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------


FILE: D:\wamp64\www\demo8\modules\custom\madness\src\Plugin\Block\TopMadness.php
----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------
 9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Link.
----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------

Time: 775ms; Memory: 10MB

Steps to reproduce

Run PHPCS on this module.

Proposed resolution

Fix the coding standards.

Remaining tasks

Submit the patch either MR.

๐Ÿ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia amanmansuri72

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024