Fix the issues reported by phpcs

Created on 24 April 2023, over 1 year ago
Updated 17 July 2024, 5 months ago

endor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig web/modules/contrib/colorbox_media_video/

FILE: /var/www/html/vbd7/web/modules/contrib/colorbox_media_video/colorbox_media_video.info.yml
-----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
9 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
-----------------------------------------------------------------------------------------------

FILE: /var/www/html/vbd7/web/modules/contrib/colorbox_media_video/src/Plugin/Field/FieldFormatter/ColorboxMediaRemoteVideoFormatter.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 15 ERRORS AFFECTING 14 LINES
---------------------------------------------------------------------------------------------------------------------------------------
22 | ERROR | [x] Doc comment short description must end with a full stop
80 | ERROR | [ ] Parameter $image_style_storage is not described in comment
108 | ERROR | [x] Expected 1 space between comma and type hint "ModuleHandlerInterface"; 2 found
108 | ERROR | [x] Expected one space after the comma, 2 found
145 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
146 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
147 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
148 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
149 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
150 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
151 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
194 | ERROR | [x] Array indentation error, expected 8 spaces but found 10
195 | ERROR | [x] Array closing indentation error, expected 6 spaces but found 8
423 | ERROR | [x] Expected 1 blank line after function; 0 found
424 | ERROR | [x] The closing brace for the class must have an empty line before it
---------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vbd7/web/modules/contrib/colorbox_media_video/css/colorbox-media-video.css
----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
1 | ERROR | [x] Expected 1 space before opening brace of class definition; 0 found
----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------

FILE: /var/www/html/vbd7/web/modules/contrib/colorbox_media_video/README.txt
----------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------------
14 | WARNING | [ ] Line exceeds 80 characters; contains 89 characters
53 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------

FILE: /var/www/html/vbd7/web/modules/contrib/colorbox_media_video/colorbox_media_video.theme.inc
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AND 1 WARNING AFFECTING 6 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
12 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
71 | ERROR | [ ] The array declaration extends to column 121 (the limit is 80). The array content should be split up over multiple lines
111 | ERROR | [ ] The array declaration extends to column 124 (the limit is 80). The array content should be split up over multiple lines
166 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
185 | ERROR | [x] Expected 1 space after IF keyword; 0 found
185 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
190 | ERROR | [x] Expected 1 space after IF keyword; 0 found
190 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------

Time: 672ms; Memory: 14MB

Proposed resolution

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

šŸ“Œ Task
Status

RTBC

Version

2.0

Component

Code

Created by

šŸ‡®šŸ‡³India dineshkumarbollu

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

Merge Requests

Comments & Activities

  • Issue created by @dineshkumarbollu
  • Status changed to Needs review over 1 year ago
  • Issue was unassigned.
  • Status changed to Needs work over 1 year ago
  • šŸ‡µšŸ‡­Philippines paraderojether

    Hi dineshkumarbollu

    I reviewed patch #2 and there are still remaining warnings and errors shown below:

    FILE: /Users/studenttrainees/Drupal2/drupalsite/docroot/modules/contrib/colorbox_media_video/colorbox_media_video.info.yml
    --------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------
    9 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
    --------------------------------------------------------------------------------------------------------------------------

    FILE: /Users/studenttrainees/Drupal2/drupalsite/docroot/modules/contrib/colorbox_media_video/README.md
    ------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ------------------------------------------------------------------------------------------------------
    11 | WARNING | Line exceeds 80 characters; contains 109 characters
    32 | WARNING | Line exceeds 80 characters; contains 143 characters
    ------------------------------------------------------------------------------------------------------

    FILE: /Users/studenttrainees/Drupal2/drupalsite/docroot/modules/contrib/colorbox_media_video/colorbox_media_video.theme.inc
    ---------------------------------------------------------------------------------------------------------------------------
    FOUND 6 ERRORS AFFECTING 3 LINES
    ---------------------------------------------------------------------------------------------------------------------------
    146 | ERROR | [x] Expected 1 space after ELSEIF keyword; 0 found
    146 | ERROR | [x] Expected 1 space before "=="; 0 found
    199 | ERROR | [x] Expected 1 space after IF keyword; 0 found
    199 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
    204 | ERROR | [x] Expected 1 space after IF keyword; 0 found
    204 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
    ---------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------------------

    Time: 448ms; Memory: 12MB

    Please check.
    Thank You.

  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡³India Ashutosh Ahirwal India

    Providing patch with phpcs issue fixes.

  • Status changed to Needs work 11 months ago
  • šŸ‡·šŸ‡ŗRussia zniki.ru

    Thanks for your patch.

    +++ b/colorbox_media_video.info.yml
    @@ -6,4 +6,4 @@ core_version_requirement: ^8.8 || ^9
    +  - colorbox:colorbox
    

    This shoule be drupal/colorbox.

    +++ b/colorbox_media_video.theme.inc
    @@ -9,7 +9,9 @@ use Drupal\Component\Utility\Crypt;
    - * Prepares variables for colorbox_media_remote_video_formatter formatter templates.
    + * Prepares variables for colorbox_media_remote_video_formatter.
    + *
    + * Formatter templates.
    

    Second sentence doesn't make any sense. You can use.

    Prepares variables for colorbox_media_remote_video_formatter templates.

  • Status changed to Needs review 10 months ago
  • šŸ‡®šŸ‡³India viren18febS

    H,
    i have changed the the points mentioned in comment.

  • Status changed to Needs work 10 months ago
  • šŸ‡·šŸ‡ŗRussia zniki.ru

    Please provide interdiff ā†’ .

    +++ b/colorbox_media_video.info.yml
    @@ -6,4 +6,4 @@ core_version_requirement: ^8.8 || ^9
    +  - drupal/colorbox
    

    My bad, I was wrong. This should be

     - colorbox/colorbox
    

    because colorbox is not part of drupal core.

  • First commit to issue fork.
  • Merge request !4Fixing phpcs issues. ā†’ (Open) created by Unnamed author
  • Status changed to Needs review 10 months ago
  • šŸ‡®šŸ‡³India bharath-kondeti Hyderabad
  • Status changed to Needs work 5 months ago
  • Hi @bindu r,

    The patch you provided could not be applied automatically, I had to input the path manually. It still resulted some errors. Please see below:

    contrib git:(master) āœ— curl https://www.drupal.org/files/issues/2024-01-29/phpcs-fixes-3355971-10.patch | patch -p7
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  7858  100  7858    0     0  71675      0 --:--:-- --:--:-- --:--:-- 83595
    missing header for unified diff at line 5 of patch
    can't find file to patch at input line 5
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |diff --git a/README.txt b/README.txt
    |index 8be8c8c..05d68eb 100644
    |--- a/README.txt
    |+++ b/README.txt
    --------------------------
    File to patch: colorbox_media_video/README.txt
    patching file colorbox_media_video/README.txt
    missing header for unified diff at line 25 of patch
    can't find file to patch at input line 25
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |diff --git a/colorbox_media_video.info.yml b/colorbox_media_video.info.yml
    |index 587f97a..04e1c79 100644
    |--- a/colorbox_media_video.info.yml
    |+++ b/colorbox_media_video.info.yml
    --------------------------
    File to patch: colorbox_media_video/colorbox_media_video.info.yml
    patching file colorbox_media_video/colorbox_media_video.info.yml
    missing header for unified diff at line 35 of patch
    can't find file to patch at input line 35
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |diff --git a/colorbox_media_video.theme.inc b/colorbox_media_video.theme.inc
    |index 4fb6a55..d9fec21 100644
    |--- a/colorbox_media_video.theme.inc
    |+++ b/colorbox_media_video.theme.inc
    --------------------------
    File to patch: colorbox_media_video/colorbox_media_video.theme.inc
    patching file colorbox_media_video/colorbox_media_video.theme.inc
    Hunk #5 FAILED at 199.
    1 out of 5 hunks FAILED -- saving rejects to file colorbox_media_video/colorbox_media_video.theme.inc.rej
    missing header for unified diff at line 107 of patch
    can't find file to patch at input line 107
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |diff --git a/css/colorbox-media-video.css b/css/colorbox-media-video.css
    |index d4cde5b..02ac6b3 100644
    |--- a/css/colorbox-media-video.css
    |+++ b/css/colorbox-media-video.css
    --------------------------
    File to patch: ./css/colorbox-media-video.css
    ./css/colorbox-media-video.css: No such file or directory
    Skip this patch? [y] n
    File to patch: colorbox_media_video/css/colorbox-media-video.css
    patching file colorbox_media_video/css/colorbox-media-video.css
    missing header for unified diff at line 116 of patch
    can't find file to patch at input line 116
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |diff --git a/src/Plugin/Field/FieldFormatter/ColorboxMediaRemoteVideoFormatter.php b/src/Plugin/Field/FieldFormatter/ColorboxMediaRemoteVideoFormatter.php
    |index f79b6a1..6f5c96b 100644
    |--- a/src/Plugin/Field/FieldFormatter/ColorboxMediaRemoteVideoFormatter.php
    |+++ b/src/Plugin/Field/FieldFormatter/ColorboxMediaRemoteVideoFormatter.php
    --------------------------
    File to patch: colorbox_media_video/src/Plugin/Field/FieldFormatter/ColorboxMediaRemoteVideoFormatter.php
    patching file colorbox_media_video/src/Plugin/Field/FieldFormatter/ColorboxMediaRemoteVideoFormatter.php
    
    āžœ  colorbox_media_video git:(2.0.1) āœ— cd ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig colorbox_media_video
    
    FILE: ...v9/web/modules/contrib/colorbox_media_video/colorbox_media_video.theme.inc
    --------------------------------------------------------------------------------
    FOUND 4 ERRORS AFFECTING 2 LINES
    --------------------------------------------------------------------------------
     202 | ERROR | [x] Expected 1 space after IF keyword; 0 found
     202 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
     207 | ERROR | [x] Expected 1 space after IF keyword; 0 found
     207 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    Time: 286ms; Memory: 12MB

    Kindly check

    Thanks,
    Jake

  • Assigned to hetal.solanki
  • Issue was unassigned.
  • Status changed to RTBC 5 months ago
  • šŸ‡®šŸ‡³India hetal.solanki

    @dineshkumarbollu, @a.aaronjake

    After the Git clone, I used the command to check for issues. I saw that there is no coding standard issue remaining.

    So I am moving it forward to Need To Review.

Production build 0.71.5 2024