Remove Ajax namespaces since we are not using those.

Comments

uditrawat created an issue. See original summary.

andrewmacpherson’s picture

Status: Active » Reviewed & tested by the community
Issue tags: -namespaces

I double-checked all use statements. The patch catches all of them.

andrewmacpherson’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new6.13 KB

As well as the unused use statements, there are many coding standards errors and warnings. Apart from the unused namespaces, the rest of them seem to all be about whitespace.

They can all be fixed automatically using the phpbcf command configured in Drupal's composer file.
The patch here contains all of the automated fixes, including the namespace ones that @uditrawat provided.

Here's the output of composer phpcs modules/contrib/embed_view_block/:

> phpcs --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer -- 'modules/contrib/embed_view_block/'

FILE: ...les/contrib/embed_view_block/src/Plugin/Block/EmbedViewBlock.php
----------------------------------------------------------------------
FOUND 75 ERRORS AND 3 WARNINGS AFFECTING 40 LINES
----------------------------------------------------------------------
   8 | WARNING | [x] Unused use statement
   9 | WARNING | [x] Unused use statement
  10 | WARNING | [x] Unused use statement
  10 | ERROR   | [x] There must be one blank line after the last USE
     |         |     statement; 0 found;
  20 | ERROR   | [x] Expected 1 space before opening brace; found 0
  28 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
  28 | ERROR   | [x] Whitespace found at end of line
  29 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
  29 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
     |         |     found 1
  42 | ERROR   | [x] Expected 1 space after "=>"; 2 found
  46 | ERROR   | [x] Whitespace found at end of line
  47 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
  47 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
     |         |     found 1
  49 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
     |         |     found 6
  50 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
     |         |     found 6
  51 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
     |         |     found 6
  52 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
     |         |     found 6
  53 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
     |         |     found 6
  54 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
     |         |     found 6
  54 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
  54 | ERROR   | [x] Whitespace found at end of line
  56 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
  56 | ERROR   | [x] Whitespace found at end of line
  65 | ERROR   | [x] Expected 1 blank line after function; 2 found
  74 | ERROR   | [x] No space found before comment text; expected "//
     |         |     $this->configuration['view_name'] =
     |         |     $form_state->getValue('view_name');" but found
     |         |     "//$this->configuration['view_name'] =
     |         |     $form_state->getValue('view_name');"
  84 | ERROR   | [x] No space found before comment text; expected "//
     |         |     $view_name = $this->configuration['view_name'];"
     |         |     but found "//$view_name =
     |         |     $this->configuration['view_name'];"
  85 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
  85 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
     |         |     found 1
  86 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
  86 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
     |         |     found 1
  88 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
  88 | ERROR   | [x] Whitespace found at end of line
  89 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
  89 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
     |         |     found 1
  89 | ERROR   | [x] No space found before comment text; expected "//
     |         |     Support basic token;" but found "//Support basic
     |         |     token;"
  90 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
  90 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
     |         |     found 1
  91 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
  91 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
     |         |     found 1
  92 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
  92 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
     |         |     found 1
  92 | ERROR   | [x] Expected 1 space after FOREACH keyword; 0 found
  92 | ERROR   | [x] Expected 1 space after closing parenthesis;
     |         |     found 0
  93 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
  93 | ERROR   | [x] Line indented incorrectly; expected 6 spaces,
     |         |     found 3
  94 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
  94 | ERROR   | [x] Line indented incorrectly; expected 6 spaces,
     |         |     found 3
  94 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
  94 | ERROR   | [x] Expected 1 space after closing parenthesis;
     |         |     found 0
  95 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
  95 | ERROR   | [x] Line indented incorrectly; expected 8 spaces,
     |         |     found 4
  95 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
  95 | ERROR   | [x] Expected 1 space after closing parenthesis;
     |         |     found 0
  96 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
  96 | ERROR   | [x] Line indented incorrectly; expected 10 spaces,
     |         |     found 4
  97 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
  97 | ERROR   | [x] Line indented incorrectly; expected 8 spaces,
     |         |     found 4
  97 | ERROR   | [x] Expected newline after closing brace
  97 | ERROR   | [x] Expected 1 space after ELSE keyword; 0 found
  98 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
  98 | ERROR   | [x] Line indented incorrectly; expected 10 spaces,
     |         |     found 3
  99 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
  99 | ERROR   | [x] Line indented incorrectly; expected 8 spaces,
     |         |     found 4
 100 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
 100 | ERROR   | [x] Line indented incorrectly; expected 6 spaces,
     |         |     found 3
 101 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
 101 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
     |         |     found 1
 101 | ERROR   | [x] Spaces must be used for alignment; tabs are not
     |         |     allowed
 101 | ERROR   | [x] Whitespace found at end of line
 102 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
 102 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
     |         |     found 1
 103 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
 103 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
     |         |     found 1
 104 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
 104 | ERROR   | [x] Whitespace found at end of line
 107 | ERROR   | [x] Line indented incorrectly; expected 6 spaces,
     |         |     found 7
 110 | ERROR   | [x] Spaces must be used to indent lines; tabs are
     |         |     not allowed
 110 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
     |         |     found 1
----------------------------------------------------------------------
PHPCBF CAN FIX THE 78 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...ontrib/embed_view_block/src/Plugin/Derivative/EmbedViewBlock.php
----------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 6 LINES
----------------------------------------------------------------------
  6 | ERROR | [x] There must be one blank line after the last USE
    |       |     statement; 2 found;
 14 | ERROR | [x] Expected 1 space before opening brace; found 0
 20 | ERROR | [x] Expected 1 blank line before function; 2 found
 21 | ERROR | [x] Spaces must be used to indent lines; tabs are not
    |       |     allowed
 21 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found
    |       |     1
 24 | ERROR | [x] Concat operator must be surrounded by a single
    |       |     space
 25 | ERROR | [x] Spaces must be used to indent lines; tabs are not
    |       |     allowed
 25 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found
    |       |     3
----------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...croot/modules/contrib/embed_view_block/embed_view_block.info.yml
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 5 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 71ms; Memory: 8MB
andrewmacpherson’s picture

Title: Remove unused namespaces » Remove unused namespaces, and whitespace fixes

g089h515r806’s picture

Status: Needs review » Fixed

commited

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.