Module have PHPCS Issues

Created on 18 March 2024, 3 months ago
Updated 19 April 2024, 2 months ago

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

I found the following warings

FILE: /var/www/html/web/modules/contrib/podtoo/src/Plugin/Field/FieldFormatter/PodTooEmbedFormatter.php
-------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------
76 | WARNING | Avoid backslash escaping in translatable strings when possible, use "" quotes instead
162 | WARNING | Avoid backslash escaping in translatable strings when possible, use "" quotes instead
-------------------------------------------------------------------------------------------------------

FILE: /var/www/html/web/modules/contrib/podtoo/src/Form/PodTooForm.php
---------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 4 LINES
---------------------------------------------------------------------------------------------------------------------------------
10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\media_library\Form\AddFormBase.
131 | ERROR | [x] Expected "void|true" but found "void|TRUE" for function return type
131 | ERROR | [ ] @return doc comment specified, but function has no return statement
131 | ERROR | [ ] Description for the @return value is missing
161 | ERROR | [x] Expected 1 blank line after function; 0 found
162 | ERROR | [x] The closing brace for the class must have an empty line before it
---------------------------------------------------------------------------------------------------------------------------------

I created Patch for the above issue
Hope You value my time and efforts.
Thank You !!

📌 Task
Status

RTBC

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 !1Resolve #3431310 "Module have phpcs" → (Closed) 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 RTBC 3 months ago
  • 🇵🇭Philippines paraderojether

    Hi

    I reviewed MR!1, applied it against Media Entity PodToo 1.x-dev, confirmed patch was applied successfully, and fixed all the issues reported by phpcs.

    jetherparadero@PrometSources-MacBook-Pro podtoo % curl https://git.drupalcode.org/project/podtoo/-/merge_requests/1.diff | git apply -v
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  3204    0  3204    0     0   4666      0 --:--:-- --:--:-- --:--:--  4711
    Checking patch src/Form/PodTooForm.php...
    Checking patch src/Plugin/Field/FieldFormatter/PodTooEmbedFormatter.php...
    Checking patch tests/src/Functional/PodTooEmbedFormatterTest.php...
    Applied patch src/Form/PodTooForm.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/PodTooEmbedFormatter.php cleanly.
    Applied patch tests/src/Functional/PodTooEmbedFormatterTest.php cleanly.
    jetherparadero@PrometSources-MacBook-Pro podtoo % cd ..
    jetherparadero@PrometSources-MacBook-Pro contrib % phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml podtoo
    jetherparadero@PrometSources-MacBook-Pro contrib %

    Thank you.

  • 🇮🇳India Rajeshreeputra Pune

    I guess we can close this one in favor of 💬 Onboard to Gitlab CI/Pipeline to Media Entity PodToo Needs review and carry forward the credit.

Production build 0.69.0 2024