Fix the issues reported by phpcs

Created on 7 July 2023, 12 months ago
Updated 7 October 2023, 9 months ago

Problem/Motivation

FILE: /home/lenovo/d7to9/web/modules/contrib/best_selling_products/src/Plugin/Block/BestSellingProductsBlock.php
-------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AND 10 WARNINGS AFFECTING 14 LINES
-------------------------------------------------------------------------------------------------------------------
   9 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is
     |         |     Drupal\Core\Entity\EntityTypeBundleInfoInterface.
 153 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
 153 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
 178 | WARNING | [ ] #options values usually have to run through t() for translation
 179 | WARNING | [ ] #options values usually have to run through t() for translation
 180 | WARNING | [ ] #options values usually have to run through t() for translation
 181 | WARNING | [ ] #options values usually have to run through t() for translation
 182 | WARNING | [ ] #options values usually have to run through t() for translation
 183 | WARNING | [ ] #options values usually have to run through t() for translation
 184 | WARNING | [ ] #options values usually have to run through t() for translation
 185 | WARNING | [ ] #options values usually have to run through t() for translation
 186 | WARNING | [ ] #options values usually have to run through t() for translation
 187 | WARNING | [ ] #options values usually have to run through t() for translation
 189 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 196 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/d7to9/web/modules/contrib/best_selling_products/src/Service/ProductsServiceInterface.php
-----------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------------------------
  7 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
 16 | ERROR   | Parameter tags must be grouped together in a doc comment
 19 | ERROR   | Parameter tags must be grouped together in a doc comment
-----------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/d7to9/web/modules/contrib/best_selling_products/src/Service/ProductsService.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
 11 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/d7to9/web/modules/contrib/best_selling_products/best_selling_products.module
-----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------

Time: 96ms; Memory: 10MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig best_selling_products

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

3.0

Component

Code

Created by

🇮🇳India roshni27

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.69.0 2024