Great modulel!

The module has many coding standard issues.

$ phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,js,css,info,txt,md .

FILE: ...on/git_drupal_8.x/modules/contrib/image_popup/image_popup.module
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 41 | ERROR | [x] Missing function doc comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ..._8.x/modules/contrib/image_popup/js/plugins/imagepopup/plugin.js
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 29 | ERROR | [x] There should be no white space after an opening "("
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...al_8.x/modules/contrib/image_popup/src/Controller/ImagePopup.php
----------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 5 LINES
----------------------------------------------------------------------
  3 | ERROR | [x] Namespaced classes, interfaces and traits should
    |       |     not begin with a file doc comment
 26 | ERROR | [x] Expected 1 blank line before function; 0 found
 41 | ERROR | [x] Concat operator must be surrounded by a single
    |       |     space
 41 | ERROR | [x] Concat operator must be surrounded by a single
    |       |     space
 42 | ERROR | [x] No space found before comment text; expected "//
    |       |     return [" but found "//return ["
 42 | ERROR | [x] Inline comments must start with a capital letter
 45 | ERROR | [x] No space found before comment text; expected "//
    |       |     ];" but found "//];"
 45 | ERROR | [x] Inline comments must end in full-stops, exclamation
    |       |     marks, colons, question marks, or closing
    |       |     parentheses
----------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: .../modules/contrib/image_popup/src/Form/EditorImagePopupDialog.php
----------------------------------------------------------------------
FOUND 12 ERRORS AND 2 WARNINGS AFFECTING 8 LINES
----------------------------------------------------------------------
 155 | ERROR   | [x] No space found before comment text; expected "//
     |         |     if (isset($image_element['data-align'])) {" but
     |         |     found "//if
     |         |     (isset($image_element['data-align'])) {"
 157 | WARNING | [ ] Line exceeds 80 characters; contains 105
     |         |     characters
 162 | WARNING | [x] There must be no blank line following an inline
     |         |     comment
 162 | ERROR   | [x] No space found before comment text; expected "//
     |         |     }" but found "//}"
 162 | ERROR   | [x] Inline comments must end in full-stops,
     |         |     exclamation marks, colons, question marks, or
     |         |     closing parentheses
 245 | ERROR   | [x] Functions must not contain multiple empty lines
     |         |     in a row; found 3 empty lines
 247 | ERROR   | [ ] More than 2 empty lines are not allowed
 258 | ERROR   | [x] Expected one space after the comma, 0 found
 262 | ERROR   | [x] Concat operator must be surrounded by a single
     |         |     space
 264 | ERROR   | [x] Concat operator must be surrounded by a single
     |         |     space
 264 | ERROR   | [x] Concat operator must be surrounded by a single
     |         |     space
 264 | ERROR   | [x] Concat operator must be surrounded by a single
     |         |     space
 264 | ERROR   | [x] Concat operator must be surrounded by a single
     |         |     space
 264 | ERROR   | [x] Concat operator must be surrounded by a single
     |         |     space
----------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...les/contrib/image_popup/src/Plugin/CKEditorPlugin/ImagePopup.php
----------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
 24 | ERROR | [x] Expected 0 spaces between brackets of function
    |       |     declaration; 1 found
 24 | ERROR | [x] There should be no white space after an opening "("
 24 | ERROR | [x] There should be no white space before a closing ")"
 81 | ERROR | [ ] Doc comment short description must start with a
    |       |     capital letter
 89 | ERROR | [ ] Visibility must be declared on method
    |       |     "validateImageUploadSettings"
 90 | ERROR | [ ] If the line declaring an array spans longer than 80
    |       |     characters, each element should be broken into its
    |       |     own line
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...pup/src/Plugin/Field/FieldFormatter/ImagePopupFieldFormatter.php
----------------------------------------------------------------------
FOUND 10 ERRORS AND 4 WARNINGS AFFECTING 8 LINES
----------------------------------------------------------------------
   3 | ERROR   | [x] Namespaced classes, interfaces and traits should
     |         |     not begin with a file doc comment
  10 | WARNING | [x] Unused use statement
  11 | WARNING | [x] Unused use statement
  13 | WARNING | [x] Unused use statement
 104 | ERROR   | [x] No space found before comment text; expected "//
     |         |     $container->get('entity.manager')->getStorage('image_style_popup')"
     |         |     but found
     |         |     "//$container->get('entity.manager')->getStorage('image_style_popup')"
 183 | ERROR   | [x] Functions must not contain multiple empty lines
     |         |     in a row; found 2 empty lines
 188 | WARNING | [ ] Line exceeds 80 characters; contains 83
     |         |     characters
 188 | ERROR   | [x] No space found before comment text; expected "//
     |         |     $image_style_popup_settings =
     |         |     entity_load('image_style', $image_style_popup);"
     |         |     but found "//$image_style_popup_settings =
     |         |     entity_load('image_style', $image_style_popup);"
 188 | ERROR   | [x] Inline comments must end in full-stops,
     |         |     exclamation marks, colons, question marks, or
     |         |     closing parentheses
 208 | ERROR   | [x] Concat operator must be surrounded by a single
     |         |     space
 208 | ERROR   | [x] Concat operator must be surrounded by a single
     |         |     space
 208 | ERROR   | [x] Concat operator must be surrounded by a single
     |         |     space
 208 | ERROR   | [x] Concat operator must be surrounded by a single
     |         |     space
 208 | ERROR   | [x] Concat operator must be surrounded by a single
     |         |     space

Comments

swarad07 created an issue. See original summary.

swarad07’s picture

Status: Active » Needs review
StatusFileSize
new8.89 KB

Fixed all errors, except two warnings which are code comments.

FILE: .../modules/contrib/image_popup/src/Form/EditorImagePopupDialog.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 157 | WARNING | Line exceeds 80 characters; contains 105 characters
----------------------------------------------------------------------


FILE: ...pup/src/Plugin/Field/FieldFormatter/ImagePopupFieldFormatter.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 179 | WARNING | Line exceeds 80 characters; contains 85 characters
----------------------------------------------------------------------
Sumit Gawde’s picture

StatusFileSize
new8.65 KB

Try this one.

harivenuv’s picture

StatusFileSize
new357 bytes

Hi Sumit Gawde,

Your patch contains a white space so I have created a interdiff of your patch to remove the white space.

laravz’s picture

Should we close this issue in favor of issue 2933504? The patch on that issue fixes the coding standards for the latest phpcs rules.

swarad07’s picture

Status: Needs review » Closed (outdated)