Fix the issues reported by phpcs

Created on 10 February 2023, over 1 year ago
Updated 17 April 2023, about 1 year ago

Problem/Motivation

Getting the following errors/warnings.

FILE: /drush_delete/src/Commands/DrushDeleteCommands.php
------------------------------------------------------------------------------
FOUND 4 ERRORS AND 2 WARNINGS AFFECTING 6 LINES
------------------------------------------------------------------------------
 15 | ERROR   | [ ] Missing parameter type
 17 | ERROR   | [x] Separate the @param and @validate-module-enabled sections by a blank line.
 23 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 29 | ERROR   | [ ] Missing parameter type
 31 | ERROR   | [x] Separate the @param and @validate-module-enabled sections by a blank line.
 37 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
---------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------

Steps to reproduce

Run following command

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

Proposed resolution

The above errors/warnings need to be fixed.

📌 Task
Status

RTBC

Version

3.0

Component

Code

Created by

🇮🇳India sidharth_soman Bangalore

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

Comments & Activities

  • Issue created by @sidharth_soman
  • Status changed to Needs work over 1 year ago
  • 🇮🇳India sidharth_soman Bangalore

    Finding the following issues.. I will work on them.

    FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\drush_delete-3340828\src\Commands\DrushDeleteCommands.php
    ---------------------------------------------------------------------------------------------------------------------
    FOUND 5 ERRORS AND 2 WARNINGS AFFECTING 7 LINES
    ---------------------------------------------------------------------------------------------------------------------
      1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
     15 | ERROR   | [ ] Missing parameter type
     17 | ERROR   | [x] Separate the @param and @validate-module-enabled sections by a blank line.
     23 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
     29 | ERROR   | [ ] Missing parameter type
     31 | ERROR   | [x] Separate the @param and @validate-module-enabled sections by a blank line.
     37 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
    ---------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\drush_delete-3340828\src\DeleteContent.php
    ------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------
     1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
    ------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------
    
    Time: 1.85 secs; Memory: 4MB
    
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India sidharth_soman Bangalore

    All issues except dependency injection are fixed. Please review.

  • 🇮🇳India omkar_yewale Mumbai

    Patch updated and fixed all the reported issues/warnings, including dependency injection.

  • Status changed to RTBC about 1 year ago
  • 🇮🇳India Ashutosh Ahirwal India

    Patch #4 applied cleanly.
    Moving to RTBC.

Production build 0.69.0 2024