Coding standard issue

Created on 30 May 2023, over 1 year ago

Problem/Motivation

FILE: ...l_cms/drupal9/web/modules/contrib/svg_image/modules/svg_image_responsive/src/Plugin/Field/FieldFormatter/SvgResponsiveImageFormatter.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
 202 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
 202 | ERROR | [x] Each index in a multi-line array must be on a new line
 203 | ERROR | [x] Array closing indentation error, expected 4 spaces but found 6
----------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal_cms/drupal9/web/modules/contrib/svg_image/src/Plugin/Field/FieldWidget/SvgImageWidget.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AND 1 WARNING AFFECTING 6 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
   7 | WARNING | [x] Unused use statement
 189 | ERROR   | [ ] The array declaration extends to column 141 (the limit is 80). The array content should be split up over multiple lines
 293 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 300 | ERROR   | [ ] The array declaration extends to column 116 (the limit is 80). The array content should be split up over multiple lines
 300 | ERROR   | [ ] The array declaration extends to column 115 (the limit is 80). The array content should be split up over multiple lines
 305 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 311 | ERROR   | [ ] The array declaration extends to column 118 (the limit is 80). The array content should be split up over multiple lines
 311 | ERROR   | [ ] The array declaration extends to column 117 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupal_cms/drupal9/web/modules/contrib/svg_image/src/Plugin/Field/FieldFormatter/SvgImageFormatter.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------------------------
  48 | ERROR | Variable "ImageStyleStorage" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
  49 | ERROR | Variable "ImageStyleStorage" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 149 | ERROR | The array declaration extends to column 82 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal_cms/drupal9/web/modules/contrib/svg_image/src/Plugin/Field/FieldFormatter/SvgImageUrlFormatter.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------
 40 | ERROR | Variable "ImageStyleStorage" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 41 | ERROR | Variable "ImageStyleStorage" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
-----------------------------------------------------------------------------------------------------------------------------

Time: 222ms; Memory: 12MB
📌 Task
Status

Active

Version

3.0

Component

Code

Created by

🇮🇳India Rohit Rana

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

Comments & Activities

  • Issue created by @Rohit Rana
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work over 1 year ago
  • 🇵🇭Philippines kenyoOwen

    Hi Rohit Rana

    I applied your patch and there are still errors

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

    FILE: /Users/studenttrainees/Project10/drupalorg10/docroot/modules/contrib/svg_image/svg_image.install
    ------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------
    1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
    ------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------

    FILE: /Users/studenttrainees/Project10/drupalorg10/docroot/modules/contrib/svg_image/README.md
    ----------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 7 WARNINGS AFFECTING 8 LINES
    ----------------------------------------------------------------------------------------------
    4 | WARNING | [ ] Line exceeds 80 characters; contains 119 characters
    6 | WARNING | [ ] Line exceeds 80 characters; contains 115 characters
    7 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
    24 | WARNING | [ ] Line exceeds 80 characters; contains 95 characters
    26 | WARNING | [ ] Line exceeds 80 characters; contains 102 characters
    32 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
    33 | WARNING | [ ] Line exceeds 80 characters; contains 106 characters
    42 | ERROR | [x] Expected 1 newline at end of file; 2 found
    ----------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------

    Time: 672ms; Memory: 12MB

    Thank you

  • Assigned to nitin_lama
  • Issue was unassigned.
  • 🇮🇳India nitin_lama India

    Fixed the remaining phpcs errors. Please review.

  • Status changed to Needs review over 1 year ago
  • Status changed to RTBC over 1 year ago
  • 🇵🇭Philippines kenyoOwen

    Hi Rohit Rana

    I applied patch #5 that provided by nitin_lama and confirmed the remaining issues are resolved. Please see the screenshots attached.

    Thank you.

  • Status changed to Closed: duplicate 3 months ago
  • 🇩🇪Germany Grevil

    Already fixed through Drupal 11 compatibility fixes for svg_image Active !

Production build 0.71.5 2024