fix the issue reported by phpcs

Created on 18 July 2023, 11 months ago

Problem/Motivation

Getting following error/warnings:

FILE: D:\xampp\htdocs\project_10\web\modules\contrib\sdc_display\sdc_display.module
---------------------------------------------------------------------------------------------------------------------------------
FOUND 11 ERRORS AND 1 WARNING AFFECTING 10 LINES
---------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
114 | ERROR | [x] There should be no white space before a closing "]"
193 | ERROR | [ ] Missing parameter type
257 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
257 | ERROR | [x] 2 spaces found before inline comment; expected "// $props = array_map(" but found "// $props = array_map("
258 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
258 | ERROR | [ ] Comment indentation error, expected only 2 spaces
259 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
260 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
267 | WARNING | [x] 'TODO: token replacement.' should match the format '@todo Fix problem X here.'
296 | ERROR | [ ] Key specified for array entry; first entry has no key
341 | ERROR | [x] Expected "string" but found "?string" for function return type
---------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 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 sdc_display/

Proposed resolution

Above error/warnings need to be fixed.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

🇮🇳India arti_parmar

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

Comments & Activities

  • Issue created by @arti_parmar
  • Issue was unassigned.
  • Status changed to Needs review 11 months ago
  • 🇮🇳India arti_parmar

    Kindly review patch.

  • Status changed to Needs work 11 months ago
  • 🇵🇭Philippines clarkssquared

    Hi arti_parmar

    I applied and reviewed your patch #2 and Confirmed that your patch fixed all the PHPCS errors except the error below

    FILE: /Users/studenttrainees/sdc_display/sdc_display.module
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
    296 | ERROR | Key specified for array entry; first entry has no key
    ----------------------------------------------------------------------

    Time: 255ms; Memory: 12MB

    please look at the screenshot I attached for your reference

    Thank you

  • Status changed to Closed: won't fix 11 months ago
  • e0ipso Can Picafort

    Thanks for your contribution, but this repo is not ready for PHPCS scans yet.

    I am sorry.

Production build 0.69.0 2024