Module have PHPCS Issue

Created on 18 March 2024, 3 months ago
Updated 6 June 2024, 20 days ago

hi @Marcus_Johansson

when I run the command
phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml
for you module

I have the following errors

FILE: /var/www/html/web/modules/contrib/did/src/Did.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Config\ConfigFactory.
36 | ERROR | [ ] Parameter $fileSystem is not described in comment
59 | ERROR | [x] Expected "int" but found "integer" for parameter type
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/web/modules/contrib/did/modules/ai_interpolator_did/src/Plugin/AiInterpolatorFieldRules/AudioToDidAvatar.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------
184 | ERROR | [x] Space found before square bracket; expected "$form[" but found "$form ["
293 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------

I have created a patch for the above error.
Hope you value my time and efforts.
Thank You !!

📌 Task
Status

Needs work

Version

1.0

Component

Code

Created by

🇮🇳India Harpreet_singh_saluja

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

Merge Requests

Comments & Activities

  • Issue created by @Harpreet_singh_saluja
  • First commit to issue fork.
  • Merge request !2Issue#3431327: Fix phpcs issues. → (Open) created by sakthi_dev
  • Status changed to Needs review 3 months ago
  • 🇮🇳India sakthi_dev

    Fixed all the phpcs issues. Please review.

  • Status changed to Needs work 20 days ago
  • 🇵🇭Philippines cleavinjosh

    Hi @sakthi_dev,

    I tried applying MR!2 and it is not applied smoothly.

    ➜  did git:(main) ✗ curl https://git.drupalcode.org/project/did/-/merge_requests/2.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  2733    0  2733    0     0   5987      0 --:--:-- --:--:-- --:--:--  5993
    patching file did.info.yml
    Hunk #1 FAILED at 3.
    1 out of 1 hunk FAILED -- saving rejects to file did.info.yml.rej
    patching file modules/ai_interpolator_did/src/Plugin/AiInterpolatorFieldRules/AudioToDidAvatar.php
    patching file src/Did.php

    Thank you.

Production build 0.69.0 2024