Fix Coding Standards

Created on 9 June 2022, over 2 years ago
Updated 21 August 2024, 3 months ago

Problem/Motivation

Run phpcs against the module code to find the following errors:

FILE: ...ontrib_Envs/Modules/web/modules/contrib/iframe_video/iframe_video.info.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------
 7 | WARNING | [ ] All dependencies must be prefixed with the project name, for
   |         |     example "drupal:"
 8 | WARNING | [ ] All dependencies must be prefixed with the project name, for
   |         |     example "drupal:"
 9 | WARNING | [ ] All dependencies must be prefixed with the project name, for
   |         |     example "drupal:"
 9 | ERROR   | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...s/web/modules/contrib/iframe_video/src/Plugin/media/Source/IframeVideo.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------
  5 | WARNING | [x] Unused use statement
  6 | WARNING | [x] Unused use statement
 20 | ERROR   | [x] Additional blank lines found at end of doc comment
 24 | ERROR   | [x] Missing function doc comment
 24 | ERROR   | [x] Expected 1 blank line before function; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: .../Contrib_Envs/Modules/web/modules/contrib/iframe_video/iframe_video.module
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 32 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 85ms; Memory: 10MB

Steps to reproduce

Run phpcs

📌 Task
Status

Needs work

Version

1.0

Component

Code

Created by

🇧🇷Brazil bruno.bicudo Bragança Paulista - São Paulo

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

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • Status changed to Needs work 3 months ago
  • 🇵🇭Philippines cleavinjosh

    Hi @Sonalmg,

    I applied MR!4, it was applied smoothly and fixed most of the phpcs issues.

    These are the remaining issues after I ran phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml:

    ➜  iframe_video git:(1.0.2) curl https://git.drupalcode.org/project/iframe_video/-/merge_requests/4.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  1709    0  1709    0     0   3896      0 --:--:-- --:--:-- --:--:--  3892
    patching file iframe_video.info.yml
    patching file iframe_video.module
    patching file src/Plugin/media/Source/IframeVideo.php
    ➜  iframe_video git:(1.0.2) ✗ ..
    ➜  contrib phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig iframe_video
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/iframe_video/iframe_video.info.yml
    -------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    -------------------------------------------------------------------------------------------------------
     7 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
     8 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
     9 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
    -------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/iframe_video/src/Form/IframeForm.php
    --------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------
     14 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\media_library\Form\AddFormBase.
    --------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/iframe_video/src/Plugin/media/Source/IframeVideo.php
    -------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------
     24 | ERROR | [x] Expected 1 blank line before function; 0 found
    -------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------------
    
    Time: 122ms; Memory: 10MB
    
    ➜  contrib

    Moreover, MR!4 is 3 commits behind the target branch.

    Thank you.

Production build 0.71.5 2024