Fix coding standard issue | PHPCS

Created on 1 February 2023, almost 2 years ago
Updated 10 February 2023, almost 2 years ago

Problem/Motivation

Fix following coding standard issue reported in PHPCS.

FILE: /Applications/MAMP/htdocs/d9/web/modules/contrib/easy_google_analytics_counter/easy_google_analytics_counter.api.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------
30 | ERROR | Type hint "array" missing for $update_nids
--------------------------------------------------------------------------------------------------------------------------

FILE: /Applications/MAMP/htdocs/d9/web/modules/contrib/easy_google_analytics_counter/src/Form/AdminForm.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
119 | ERROR | The array declaration extends to column 98 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------

FILE: /Applications/MAMP/htdocs/d9/web/modules/contrib/easy_google_analytics_counter/src/ConnectionService.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
-----------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Non-namespaced classes/interfaces/traits should not be referenced with use statements
10 | ERROR | [x] Non-namespaced classes/interfaces/traits should not be referenced with use statements
11 | ERROR | [x] Non-namespaced classes/interfaces/traits should not be referenced with use statements
12 | ERROR | [x] Non-namespaced classes/interfaces/traits should not be referenced with use statements
13 | ERROR | [x] Non-namespaced classes/interfaces/traits should not be referenced with use statements
254 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
-----------------------------------------------------------------------------------------------------------------------

๐Ÿ“Œ Task
Status

Fixed

Version

2.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia noorulshameera

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @noorulshameera
  • Status changed to Needs review almost 2 years ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia noorulshameera

    Adding patch to fix PHPCS issue.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Charchil Khandelwal

    Charchil Khandelwal โ†’ made their first commit to this issueโ€™s fork.

  • Assigned to Charchil Khandelwal
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Charchil Khandelwal

    I will review this patch.

  • Status changed to Needs work almost 2 years ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Charchil Khandelwal

    FILE: ...y_google_analytics_counter\easy_google_analytics_counter.api.php
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ----------------------------------------------------------------------
    7 | WARNING | @author tags are not usually used in Drupal, because
    | | over time multiple contributors will touch the code
    | | anyway
    31 | WARNING | Unused variable $nid.
    ----------------------------------------------------------------------

    FILE: ...\modules\easy_google_analytics_counter\src\ConnectionService.php
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    ----------------------------------------------------------------------
    9 | WARNING | There must be no blank line following an inline
    | | comment
    14 | WARNING | The class short comment should describe what the
    | | class does and not simply repeat the class name
    173 | WARNING | Unused variable $reportIndex.
    ----------------------------------------------------------------------

    FILE: ...easy_google_analytics_counter\src\ConnectionServiceInterface.php
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------
    7 | WARNING | The class short comment should describe what the class
    | | does and not simply repeat the class name
    ----------------------------------------------------------------------

    FILE: ...pal\modules\easy_google_analytics_counter\src\Form\AdminForm.php
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------
    14 | WARNING | The class short comment should describe what the
    | | class does and not simply repeat the class name
    ----------------------------------------------------------------------

    Need to fix these warnings.

  • @charchil-khandelwal opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Charchil Khandelwal

    All warnings are fixed now.
    Created MR for this issue.
    Please review.

  • Assigned to himanshu_jhaloya
  • Issue was unassigned.
  • Status changed to RTBC almost 2 years ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia himanshu_jhaloya Indore

    Hi @charchil-khandelwal Reviewed the MR!3 look good checked the phpcs issues no Error & warning was found. Moving to RTBC

  • ๐Ÿ‡ญ๐Ÿ‡บHungary dj1999
  • Status changed to Fixed almost 2 years ago
  • ๐Ÿ‡ญ๐Ÿ‡บHungary dj1999
Production build 0.71.5 2024