There are some CS issues.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Aston Victor created an issue. See original summary.

astonvictor’s picture

Status: Active » Needs review
StatusFileSize
new1.18 KB
astonvictor’s picture

StatusFileSize
new1.63 KB
walangitan’s picture

The patch above doesn't apply, other coding standard recommendations and updates, some of which can be fixed by coder.

FILE: google_analytics_lite/src/Form/GoogleAnalyticsLiteForm.php
---------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 2 WARNINGS AFFECTING 8 LINES
---------------------------------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] The PHP open tag must be followed by exactly one blank line
  2 | ERROR   | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
 10 | WARNING | [x] Unused use statement
 22 | ERROR   | [x] Short array syntax must be used to define arrays
 38 | ERROR   | [x] Short array syntax must be used to define arrays
 45 | ERROR   | [x] Short array syntax must be used to define arrays
 48 | ERROR   | [x] Short array syntax must be used to define arrays
 50 | WARNING | [x] A comma should follow the last multiline array item. Found: 'Universal'
---------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------
FILE: google_analytics_lite/google_analytics_lite.module
-------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------
 9 | WARNING | @author tags are not usually used in Drupal, because over time multiple contributors will touch the code anyway
-------------------------------------------------------------------------------------------------------------------------------
FILE: google_analytics_lite/src/Form/GoogleAnalyticsLiteForm.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
 40 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 42 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 47 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 49 | WARNING | #options values usually have to run through t() for translation
-----------------------------------------------------------------------------------------------------------------------------------------
walangitan’s picture

Status: Needs review » Needs work
s1933’s picture

hi,

this patch fixes all errors with Drupal, DrupalPractice standard.

s1933’s picture

Status: Needs work » Needs review

dipesh_goswami made their first commit to this issue’s fork.

dipesh_goswami’s picture

Assigned: Unassigned » dipesh_goswami

Hi,
I am reviewing your patch.
Thanks.

dipesh_goswami’s picture

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

Hi,
Your patch applied cleanly:

dipes@Lucky MINGW64 /c/xampp/htdocs/Contribution-project/web/modules/contrib/google_analytics_lite-2996113 (2996113-coding-standard)
$ git apply -v 2996113_google_analytics_lite_cs_fix_6.patch
Checking patch google_analytics_lite.module...
Checking patch src/Form/GoogleAnalyticsLiteForm.php...
Applied patch google_analytics_lite.module cleanly.
Applied patch src/Form/GoogleAnalyticsLiteForm.php cleanly.

dipes@Lucky MINGW64 /c/xampp/htdocs/Contribution-project/web/modules/contrib/google_analytics_lite-2996113 (2996113-coding-standard)

All the coding standard issues are resolved:

dipes@Lucky MINGW64 /c/xampp/htdocs/Contribution-project/web/modules/contrib
$ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig google_analytics_lite-2996113/

FILE: ...modules\contrib\google_analytics_lite-2996113\google_analytics_lite.module
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 9 | WARNING | @author tags are not usually used in Drupal, because over time
   |         | multiple contributors will touch the code anyway
--------------------------------------------------------------------------------


FILE: ...contrib\google_analytics_lite-2996113\src\Form\GoogleAnalyticsLiteForm.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 44 | WARNING | #options values usually have to run through t() for translation
 45 | WARNING | #options values usually have to run through t() for translation
--------------------------------------------------------------------------------

Time: 172ms; Memory: 10MB


dipes@Lucky MINGW64 /c/xampp/htdocs/Contribution-project/web/modules/contrib
$

So, moving it to RTBC.
Thanks for your patch.