Problem/Motivation

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

FILE: /Users/specbee/Sites/Projects/sitewide_alert/js/init.es6.js
-------------------------------------------------------------------------------------------------
FOUND 41 ERRORS AFFECTING 25 LINES
-------------------------------------------------------------------------------------------------
   1 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
   4 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
   6 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
   9 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
  18 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  22 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  31 | ERROR | [x] Expected 1 space before "-"; 0 found
  31 | ERROR | [x] Expected 1 space after "-"; 0 found
  31 | ERROR | [x] Expected 1 space before "-"; 0 found
  31 | ERROR | [x] Expected 1 space after "-"; 0 found
  32 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
  36 | ERROR | [x] Expected 1 space before "-"; 0 found
  36 | ERROR | [x] Expected 1 space after "-"; 0 found
  36 | ERROR | [x] Expected 1 space before "-"; 0 found
  36 | ERROR | [x] Expected 1 space after "-"; 0 found
  45 | ERROR | [x] Expected 1 space before "-"; 0 found
  45 | ERROR | [x] Expected 1 space after "-"; 0 found
  45 | ERROR | [x] Expected 1 space before "-"; 0 found
  45 | ERROR | [x] Expected 1 space after "-"; 0 found
  48 | ERROR | [x] Expected 1 space before "-"; 0 found
  48 | ERROR | [x] Expected 1 space after "-"; 0 found
  48 | ERROR | [x] Expected 1 space before "="; 0 found
  48 | ERROR | [x] Expected 1 space after "="; 0 found
  51 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  52 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  74 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  75 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  85 | ERROR | [x] Expected 1 space before "/"; 0 found
  85 | ERROR | [x] Expected 1 space after "/"; 0 found
 132 | ERROR | [x] Expected 1 space before "-"; 0 found
 132 | ERROR | [x] Expected 1 space after "-"; 0 found
 132 | ERROR | [x] Expected 1 space before "="; 0 found
 132 | ERROR | [x] Expected 1 space after "="; 0 found
 144 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 145 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 159 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 166 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 174 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 189 | ERROR | [x] Space before opening parenthesis of function call prohibited
 199 | ERROR | [x] Space before opening parenthesis of function call prohibited
 238 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
-------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 41 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/sitewide_alert/js/init.js
----------------------------------------------------------------------------------------------
FOUND 38 ERRORS AFFECTING 22 LINES
----------------------------------------------------------------------------------------------
   9 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  11 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  13 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
  20 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  24 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  31 | ERROR | [x] Expected 1 space before "-"; 0 found
  31 | ERROR | [x] Expected 1 space after "-"; 0 found
  31 | ERROR | [x] Expected 1 space before "-"; 0 found
  31 | ERROR | [x] Expected 1 space after "-"; 0 found
  32 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
  34 | ERROR | [x] Expected 1 space before "-"; 0 found
  34 | ERROR | [x] Expected 1 space after "-"; 0 found
  34 | ERROR | [x] Expected 1 space before "-"; 0 found
  34 | ERROR | [x] Expected 1 space after "-"; 0 found
  38 | ERROR | [x] Expected 1 space before "-"; 0 found
  38 | ERROR | [x] Expected 1 space after "-"; 0 found
  38 | ERROR | [x] Expected 1 space before "-"; 0 found
  38 | ERROR | [x] Expected 1 space after "-"; 0 found
  39 | ERROR | [x] Expected 1 space before "-"; 0 found
  39 | ERROR | [x] Expected 1 space after "-"; 0 found
  39 | ERROR | [x] Expected 1 space before "="; 0 found
  39 | ERROR | [x] Expected 1 space after "="; 0 found
  41 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  42 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  60 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  61 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  66 | ERROR | [x] Expected 1 space before "/"; 0 found
  66 | ERROR | [x] Expected 1 space after "/"; 0 found
  86 | ERROR | [x] Expected 1 space before "-"; 0 found
  86 | ERROR | [x] Expected 1 space after "-"; 0 found
  86 | ERROR | [x] Expected 1 space before "="; 0 found
  86 | ERROR | [x] Expected 1 space after "="; 0 found
  91 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  92 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 104 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 107 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 146 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 155 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 38 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/sitewide_alert/tests/src/Functional/SitewideAlertLimitTest.php
--------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------
 7 | WARNING | [x] Unused use statement
 9 | WARNING | [x] Unused use statement
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/sitewide_alert/sitewide_alert.install
--------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------
 15 | WARNING | Line exceeds 80 characters; contains 91 characters
 31 | WARNING | Line exceeds 80 characters; contains 85 characters
 59 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
--------------------------------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/sitewide_alert/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 21 WARNINGS AFFECTING 21 LINES
----------------------------------------------------------------------
  4 | WARNING | Line exceeds 80 characters; contains 82 characters
  6 | WARNING | Line exceeds 80 characters; contains 115 characters
 12 | WARNING | Line exceeds 80 characters; contains 107 characters
 13 | WARNING | Line exceeds 80 characters; contains 96 characters
 15 | WARNING | Line exceeds 80 characters; contains 118 characters
 17 | WARNING | Line exceeds 80 characters; contains 83 characters
 18 | WARNING | Line exceeds 80 characters; contains 120 characters
 20 | WARNING | Line exceeds 80 characters; contains 111 characters
 21 | WARNING | Line exceeds 80 characters; contains 119 characters
 34 | WARNING | Line exceeds 80 characters; contains 95 characters
 36 | WARNING | Line exceeds 80 characters; contains 126 characters
 37 | WARNING | Line exceeds 80 characters; contains 120 characters
 40 | WARNING | Line exceeds 80 characters; contains 104 characters
 46 | WARNING | Line exceeds 80 characters; contains 122 characters
 57 | WARNING | Line exceeds 80 characters; contains 85 characters
 59 | WARNING | Line exceeds 80 characters; contains 119 characters
 66 | WARNING | Line exceeds 80 characters; contains 117 characters
 67 | WARNING | Line exceeds 80 characters; contains 121 characters
 68 | WARNING | Line exceeds 80 characters; contains 114 characters
 71 | WARNING | Line exceeds 80 characters; contains 119 characters
 88 | WARNING | Line exceeds 80 characters; contains 117 characters
----------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/sitewide_alert/src/SitewideAlertRenderer.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 61 | WARNING | Line exceeds 80 characters; contains 115 characters
--------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/sitewide_alert/src/Form/SitewideAlertConfigForm.php
---------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------
 19 | ERROR | Missing short description in doc comment
---------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/sitewide_alert/src/Form/SitewideAlertRevisionDeleteForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------
 124 | ERROR   | The array declaration extends to column 178 (the limit is 80). The array content should be split up over multiple lines
 125 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 125 | ERROR   | The array declaration extends to column 244 (the limit is 80). The array content should be split up over multiple lines
------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/sitewide_alert/src/Form/SitewideAlertRevisionRevertForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------
 139 | ERROR   | The array declaration extends to column 179 (the limit is 80). The array content should be split up over multiple lines
 140 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 140 | ERROR   | The array declaration extends to column 235 (the limit is 80). The array content should be split up over multiple lines
------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/sitewide_alert/src/SitewideAlertRendererInterface.php
-----------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------
  5 | ERROR | [x] There must be one blank line after the namespace declaration
 25 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/sitewide_alert/src/Plugin/Validation/Constraint/LimitToPagesConstraintValidator.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------
 36 | ERROR | Missing parameter comment
 36 | ERROR | Missing parameter type
 38 | ERROR | Description for the @return value is missing
-----------------------------------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/sitewide_alert/src/Plugin/Validation/Constraint/LimitToPagesConstraint.php
------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------
 20 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
------------------------------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/sitewide_alert/src/Plugin/Validation/Constraint/ScheduledDateProvidedConstraint.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------
  8 | WARNING | [x] Unused use statement
 22 | WARNING | [ ] Line exceeds 80 characters; contains 93 characters
-----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/sitewide_alert/src/Controller/SitewideAlertsController.php
----------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------
  24 | ERROR   | Missing short description in doc comment
  84 | WARNING | Line exceeds 80 characters; contains 86 characters
 103 | WARNING | Line exceeds 80 characters; contains 87 characters
----------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/sitewide_alert/src/Controller/SitewideAlertController.php
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------------
 123 | ERROR | [ ] The array declaration extends to column 150 (the limit is 80). The array content should be split up over multiple lines
 162 | ERROR | [x] Array closing indentation error, expected 16 spaces but found 18
-------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/sitewide_alert/src/AlertStyleProvider.php
-----------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------
 55 | WARNING | Only string literals should be passed to t() where possible
-----------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/sitewide_alert/src/SitewideAlertManager.php
-------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-------------------------------------------------------------------------------
 116 | WARNING | Line exceeds 80 characters; contains 85 characters
 131 | WARNING | Line exceeds 80 characters; contains 87 characters
 159 | WARNING | Line exceeds 80 characters; contains 112 characters
 194 | WARNING | Line exceeds 80 characters; contains 112 characters
-------------------------------------------------------------------------------

Time: 710ms; Memory: 14MB

Steps to reproduce

Run following command
phpcs --standard=“Drupal,DrupalPractice” --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,css,js .

Comments

Rakhi Soni created an issue. See original summary.

rakhi soni’s picture

Assigned: rakhi soni » Unassigned
Status: Active » Needs review
StatusFileSize
new3.55 KB

Kindly review patch,,

sourabhjain’s picture

Assigned: Unassigned » sourabhjain

I will review this patch.

sourabhjain’s picture

Assigned: sourabhjain » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new501.8 KB
new269.47 KB

I have reviewed the patch #2 and its looks good. Attaching before and after Screenshot for reference.
Moving to RTBC.

jaykumar95’s picture

patch looks fine but no need to add StringTranslationTraitas it is inherited from the FormBase.

jaykumar95’s picture

also please review the coding standard as well I doubt there are many Line exceeds 80 characters.

jaykumar95’s picture

Status: Reviewed & tested by the community » Needs review
Munavijayalakshmi’s picture

Title: t() calls should be avoided in classes » Drupal coding standards
Assigned: Unassigned » Munavijayalakshmi

After applying the #2 patch getting the following errors.

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

FILE: /var/www/html/vb/drupal-2821827/modules/contrib/sitewide_alert/sitewide_alert.install
--------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------
15 | WARNING | Line exceeds 80 characters; contains 91 characters
31 | WARNING | Line exceeds 80 characters; contains 85 characters
59 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
--------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/drupal-2821827/modules/contrib/sitewide_alert/src/AlertStyleProvider.php
-----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
55 | WARNING | Only string literals should be passed to t() where possible
-----------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/drupal-2821827/modules/contrib/sitewide_alert/src/SitewideAlertManager.php
-------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------
80 | WARNING | Line exceeds 80 characters; contains 85 characters
95 | WARNING | Line exceeds 80 characters; contains 87 characters
123 | WARNING | Line exceeds 80 characters; contains 112 characters
158 | WARNING | Line exceeds 80 characters; contains 112 characters
-------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/drupal-2821827/modules/contrib/sitewide_alert/src/Controller/SitewideAlertController.php
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------------
123 | ERROR | [ ] The array declaration extends to column 150 (the limit is 80). The array content should be split up over multiple lines
162 | ERROR | [x] Array closing indentation error, expected 16 spaces but found 18
-------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/drupal-2821827/modules/contrib/sitewide_alert/src/Controller/SitewideAlertsController.php
----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------
24 | ERROR | Missing short description in doc comment
84 | WARNING | Line exceeds 80 characters; contains 86 characters
103 | WARNING | Line exceeds 80 characters; contains 87 characters
----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/drupal-2821827/modules/contrib/sitewide_alert/src/SitewideAlertRendererInterface.php
-----------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------
5 | ERROR | [x] There must be one blank line after the namespace declaration
25 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/drupal-2821827/modules/contrib/sitewide_alert/src/SitewideAlertRenderer.php
--------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------
61 | WARNING | Line exceeds 80 characters; contains 115 characters
--------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/drupal-2821827/modules/contrib/sitewide_alert/src/Form/SitewideAlertConfigForm.php
---------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------
19 | ERROR | Missing short description in doc comment
---------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/drupal-2821827/modules/contrib/sitewide_alert/src/Form/SitewideAlertRevisionRevertForm.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------------------------
140 | ERROR | The array declaration extends to column 179 (the limit is 80). The array content should be split up over multiple lines
141 | ERROR | The array declaration extends to column 242 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/drupal-2821827/modules/contrib/sitewide_alert/src/Form/SitewideAlertRevisionDeleteForm.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------------------------
125 | ERROR | The array declaration extends to column 178 (the limit is 80). The array content should be split up over multiple lines
126 | ERROR | The array declaration extends to column 251 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/drupal-2821827/modules/contrib/sitewide_alert/src/Plugin/Validation/Constraint/ScheduledDateProvidedConstraint.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
8 | WARNING | [x] Unused use statement
22 | WARNING | [ ] Line exceeds 80 characters; contains 93 characters
-----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/drupal-2821827/modules/contrib/sitewide_alert/README.md
------------------------------------------------------------------------------
FOUND 0 ERRORS AND 21 WARNINGS AFFECTING 21 LINES
------------------------------------------------------------------------------
4 | WARNING | Line exceeds 80 characters; contains 82 characters
6 | WARNING | Line exceeds 80 characters; contains 115 characters
12 | WARNING | Line exceeds 80 characters; contains 107 characters
13 | WARNING | Line exceeds 80 characters; contains 96 characters
15 | WARNING | Line exceeds 80 characters; contains 118 characters
17 | WARNING | Line exceeds 80 characters; contains 83 characters
18 | WARNING | Line exceeds 80 characters; contains 120 characters
20 | WARNING | Line exceeds 80 characters; contains 111 characters
21 | WARNING | Line exceeds 80 characters; contains 119 characters
34 | WARNING | Line exceeds 80 characters; contains 95 characters
36 | WARNING | Line exceeds 80 characters; contains 126 characters
37 | WARNING | Line exceeds 80 characters; contains 120 characters
40 | WARNING | Line exceeds 80 characters; contains 104 characters
46 | WARNING | Line exceeds 80 characters; contains 122 characters
57 | WARNING | Line exceeds 80 characters; contains 85 characters
59 | WARNING | Line exceeds 80 characters; contains 119 characters
66 | WARNING | Line exceeds 80 characters; contains 117 characters
67 | WARNING | Line exceeds 80 characters; contains 121 characters
68 | WARNING | Line exceeds 80 characters; contains 114 characters
71 | WARNING | Line exceeds 80 characters; contains 119 characters
88 | WARNING | Line exceeds 80 characters; contains 117 characters
------------------------------------------------------------------------------

FILE: /var/www/html/vb/drupal-2821827/modules/contrib/sitewide_alert/tests/src/Functional/SitewideAlertLimitTest.php
--------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------
7 | WARNING | [x] Unused use statement
9 | WARNING | [x] Unused use statement
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------

Time: 824ms; Memory: 12MB

Munavijayalakshmi’s picture

Assigned: Munavijayalakshmi » Unassigned
Status: Needs review » Needs work
StatusFileSize
new20.97 KB
new18.67 KB

Rectified all errors except the following,

FILE: /var/www/html/vb/drupal-2821827/modules/contrib/sitewide_alert/src/AlertStyleProvider.php
-----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
55 | WARNING | Only string literals should be passed to t() where possible
-----------------------------------------------------------------------------------------------

michelecris’s picture

Assigned: Unassigned » michelecris

Hi!

I will try to fix that!

michelecris’s picture

Assigned: michelecris » Unassigned
Status: Needs work » Needs review
StatusFileSize
new21.52 KB

Hello!

I fixed the warning mentioned in #9 about string literals and no more phpcs errors found. Someone could review that if its ok?
Moving status for needs review.

thanks!

WagnerMelo’s picture

Assigned: Unassigned » WagnerMelo

hello, i'll review this issue.

WagnerMelo’s picture

StatusFileSize
new25.8 KB
new4.19 KB

Hello, i made the issue review, and found two more file with coding standards erros, two file with .js extension. And i noticed that the issue reporter tell us to use the phpcs without .js extension, and when i ran in my enviroment i used with .js extension, and found this two files.
So i fixed this two files, and made a new patch and an interdiff.
So i'll let the issue and needs review again. XD

michelecris’s picture

Assigned: WagnerMelo » michelecris

Hii!

I will review it.

michelecris’s picture

Assigned: michelecris » Unassigned
StatusFileSize
new29.87 KB

Hello!
I applied your patch @WagnerMelo in #13 but after I run phpcs with js option still showing errors from js, so I made a new patch to solve that. Please, someone could review that? So I will keep the status in needs review.

Thanks!

WagnerMelo’s picture

Assigned: Unassigned » WagnerMelo

i'll made this review. XD

WagnerMelo’s picture

Assigned: WagnerMelo » Unassigned
Status: Needs review » Reviewed & tested by the community

Hi, i reviewed this issue, and tested the patch sended by @michelecris on #15, and its works correctly.
And all errors gones.
So i'll move this issue to RTBC.

avpaderno’s picture

Title: Drupal coding standards » Fix the issues reported by phpcs
Issue tags: - +Coding standards
avpaderno’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs issue summary update

The issue's purpose has been change from removing t() calls in classes to fixing the issues reported by phpcs, but the issue summary has not been updated to reflect that; in fact, it only reports two warnings, not all the warnings/errors the patches fix.

imustakim’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update
imustakim’s picture

Issue summary updated.

chrissnyder’s picture

Thank you, everyone, for your work on this. I applied the fixes for most of the PHPCS files.

I did not apply a few of the fixes for warnings about comment line length because in those few cases, it made the documentation less helpful.

I did not include the JS file changes because they change some of the functionality and make the code more difficult to read. The PHPCS coding standards do not apply cleanly to JavaScript files. For example, PHPCS does not account for template literals appropriatly.

chrissnyder’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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