Fix the issues reported by phpcs

Created on 21 September 2022, about 2 years ago
Updated 27 April 2023, over 1 year ago

Problem/Motivation

Fix this issues reported by phpcs.

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

Errors:

FILE: /Users/specbee/Sites/Projects/twitter_feeds/twitter_feeds.libraries.yml
-----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------
 14 | ERROR | [x] Expected 1 newline at end of file; 2 found
-----------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/twitter_feeds/css/custom.css
----------------------------------------------------------------------------
FOUND 20 ERRORS AFFECTING 11 LINES
----------------------------------------------------------------------------
  2 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  2 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
  3 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  3 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
  4 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  4 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
  5 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  5 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
  6 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  6 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
  9 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
  9 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
 12 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 12 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
 13 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 13 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
 15 | ERROR | [x] Multiple selectors should each be on a single line
 16 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 16 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
 17 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------
PHPCBF CAN FIX THE 20 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/twitter_feeds/twitter_feeds.module
---------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 6 WARNINGS AFFECTING 10 LINES
---------------------------------------------------------------------------------------------
  8 | WARNING | [x] Unused use statement
  9 | WARNING | [x] Unused use statement
 11 | WARNING | [x] Unused use statement
 12 | WARNING | [x] Unused use statement
 21 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
 22 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
 23 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 4
 24 | ERROR   | [x] Case breaking statement indented incorrectly; expected 6 spaces, found 4
 36 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 39 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/twitter_feeds/twitter_feeds.info.yml
------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------
 7 | ERROR | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/twitter_feeds/templates/twitter-feeds.html.twig
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 45 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/twitter_feeds/templates/twitter-follow-button.html.twig
-------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------
 17 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/twitter_feeds/src/Plugin/Block/TwitterFollowButtonBlock.php
-------------------------------------------------------------------------------------------------------------
FOUND 18 ERRORS AND 4 WARNINGS AFFECTING 11 LINES
-------------------------------------------------------------------------------------------------------------
  47 | ERROR   | [x] Expected 1 space before "??"; 0 found
  47 | ERROR   | [x] Expected 1 space after "??"; 0 found
  50 | WARNING | [x] A comma should follow the last multiline array item. Found: true
  50 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  56 | ERROR   | [x] Expected 1 space before "??"; 0 found
  56 | ERROR   | [x] Expected 1 space after "??"; 0 found
  56 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
  58 | WARNING | [x] A comma should follow the last multiline array item. Found: )
  62 | ERROR   | [x] Expected 1 blank line after function; 2 found
  70 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
  87 | ERROR   | [x] Short array syntax must be used to define arrays
  88 | ERROR   | [x] Expected 1 space before "??"; 0 found
  88 | ERROR   | [x] Expected 1 space after "??"; 0 found
  89 | ERROR   | [x] Expected 1 space before "?"; 0 found
  89 | ERROR   | [x] Expected 1 space after "?"; 0 found
  89 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  89 | ERROR   | [x] Expected 1 space before ":"; 0 found
  89 | ERROR   | [x] Expected 1 space after ":"; 0 found
  89 | WARNING | [x] A comma should follow the last multiline array item. Found: false
  89 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
  95 | WARNING | [x] A comma should follow the last multiline array item. Found: $twitter_follow_button_data
 104 | ERROR   | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 22 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/twitter_feeds/src/Plugin/Block/TwitterFeedsBlock.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 32 ERRORS AND 13 WARNINGS AFFECTING 29 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
  47 | ERROR   | [x] Expected 1 space before "??"; 0 found
  47 | ERROR   | [x] Expected 1 space after "??"; 0 found
  50 | WARNING | [x] A comma should follow the last multiline array item. Found: true
  50 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  56 | ERROR   | [x] Expected 1 space before "??"; 0 found
  56 | ERROR   | [x] Expected 1 space after "??"; 0 found
  58 | WARNING | [ ] Avoid backslash escaping in translatable strings when possible, use "" quotes instead
  58 | WARNING | [x] A comma should follow the last multiline array item. Found: )
  66 | ERROR   | [x] Expected 1 space before "??"; 0 found
  66 | ERROR   | [x] Expected 1 space after "??"; 0 found
  69 | WARNING | [x] A comma should follow the last multiline array item. Found: true
  69 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  75 | ERROR   | [x] Expected 1 space before "??"; 0 found
  75 | ERROR   | [x] Expected 1 space after "??"; 0 found
  82 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  83 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  84 | ERROR   | [x] Short array syntax must be used to define arrays
  85 | WARNING | [ ] #options values usually have to run through t() for translation
  86 | WARNING | [ ] #options values usually have to run through t() for translation
  87 | WARNING | [ ] #options values usually have to run through t() for translation
  89 | ERROR   | [x] Expected 1 space before "??"; 0 found
  89 | ERROR   | [x] Expected 1 space after "??"; 0 found
  92 | ERROR   | [x] Short array syntax must be used to define arrays
  94 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  95 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  96 | ERROR   | [x] Expected 1 space before "??"; 0 found
  96 | ERROR   | [x] Expected 1 space after "??"; 0 found
  96 | WARNING | [x] A comma should follow the last multiline array item. Found: ''
 100 | ERROR   | [x] Expected 1 blank line after function; 2 found
 108 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
 133 | ERROR   | [x] Short array syntax must be used to define arrays
 134 | ERROR   | [x] Expected 1 space before "??"; 0 found
 134 | ERROR   | [x] Expected 1 space after "??"; 0 found
 135 | ERROR   | [x] Expected 1 space before "??"; 0 found
 135 | ERROR   | [x] Expected 1 space after "??"; 0 found
 136 | ERROR   | [x] Expected 1 space before "??"; 0 found
 136 | ERROR   | [x] Expected 1 space after "??"; 0 found
 137 | ERROR   | [x] Expected 1 space before "??"; 0 found
 137 | ERROR   | [x] Expected 1 space after "??"; 0 found
 138 | ERROR   | [x] Expected 1 space before "??"; 0 found
 138 | ERROR   | [x] Expected 1 space after "??"; 0 found
 139 | ERROR   | [x] Expected 1 space before "??"; 0 found
 139 | ERROR   | [x] Expected 1 space after "??"; 0 found
 145 | WARNING | [x] A comma should follow the last multiline array item. Found: $twitter_feeds_data
 153 | ERROR   | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 37 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------
๐Ÿ“Œ Task
Status

Fixed

Version

1.1

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia akshay.kelotra Indore

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.

Production build 0.71.5 2024