Fix the issues reported by phpcs

Created on 5 March 2024, 4 months ago
Updated 18 March 2024, 3 months ago

Steps to reproduce

When I run the reported command, I get more errors/warnings.

This is the commend
phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml

FILE: C:\xampp\htdocs\newdrupal\web\modules\contrib\smart_content_lytics\README.md
----------------------------------------------------------------------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------------------
4 | WARNING | [ ] Line exceeds 80 characters; contains 261 characters
9 | WARNING | [ ] Line exceeds 80 characters; contains 100 characters
24 | WARNING | [ ] Line exceeds 80 characters; contains 186 characters
28 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\newdrupal\web\modules\contrib\smart_content_lytics\smart_content_lytics.info.yml
-----------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-----------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\newdrupal\web\modules\contrib\smart_content_lytics\smart_content_lytics.module
----------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
9 | ERROR | [x] Opening brace should be on the same line as the declaration
11 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\newdrupal\web\modules\contrib\smart_content_lytics\src\Plugin\Derivative\LyticsConditionDeriver.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 1 WARNING AFFECTING 10 LINES
-------------------------------------------------------------------------------------------------------------------------
17 | ERROR | [x] Opening brace should be on the same line as the declaration
41 | ERROR | [x] Opening brace should be on the same line as the declaration
50 | ERROR | [x] Opening brace should be on the same line as the declaration
58 | ERROR | [x] You must use "/**" style comments for a function comment
59 | ERROR | [x] Opening brace should be on the same line as the declaration
67 | ERROR | [x] Opening brace should be on the same line as the declaration
85 | ERROR | [x] Opening brace should be on the same line as the declaration
99 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
131 | ERROR | [x] Opening brace should be on the same line as the declaration
151 | ERROR | [x] Expected 1 blank line after function; 0 found
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\newdrupal\web\modules\contrib\smart_content_lytics\src\Plugin\smart_content\Condition\Group\Lytics.php
----------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
17 | ERROR | [x] Opening brace should be on the same line as the declaration
----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\newdrupal\web\modules\contrib\smart_content_lytics\src\Plugin\smart_content\Condition\LyticsCondition.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------------------------------------
18 | ERROR | [x] Opening brace should be on the same line as the declaration
24 | ERROR | [x] Opening brace should be on the same line as the declaration
27 | ERROR | [x] Expected 1 blank line after function; 0 found
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------

๐Ÿ“Œ Task
Status

Needs review

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia jayprakash.kushwah India

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

Merge Requests

Comments & Activities

  • Issue created by @jayprakash.kushwah
  • Shruu_rao โ†’ made their first commit to this issueโ€™s fork.

  • Assigned to nitin_lama
  • Merge request !1#3425723: MR for the changes โ†’ (Open) created by nitin_lama
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama

    Please review. Thanks.

  • Issue was unassigned.
  • Status changed to Needs review 3 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Preethy_ray

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

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Yashaswi18

    On running the command phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml smart_content_lytics/ found these errors remaining:

    FILE: /home/yashaswi/contribs/smart_content_lytics/smart_content_lytics.info.yml
    -----------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------
     1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
     1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
    -----------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/yashaswi/contribs/smart_content_lytics/src/Plugin/Derivative/LyticsConditionDeriver.php
    ---------------------------------------------------------------------------------------------------
    FOUND 9 ERRORS AND 1 WARNING AFFECTING 10 LINES
    ---------------------------------------------------------------------------------------------------
      17 | ERROR   | [x] Opening brace should be on the same line as the declaration
      41 | ERROR   | [x] Opening brace should be on the same line as the declaration
      50 | ERROR   | [x] Opening brace should be on the same line as the declaration
      58 | ERROR   | [x] You must use "/**" style comments for a function comment
      59 | ERROR   | [x] Opening brace should be on the same line as the declaration
      67 | ERROR   | [x] Opening brace should be on the same line as the declaration
      85 | ERROR   | [x] Opening brace should be on the same line as the declaration
      99 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
     131 | ERROR   | [x] Opening brace should be on the same line as the declaration
     151 | ERROR   | [x] Expected 1 blank line after function; 0 found
    ---------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------
    
    
    FILE: /home/yashaswi/contribs/smart_content_lytics/src/Plugin/smart_content/Condition/LyticsCondition.php
    ---------------------------------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    ---------------------------------------------------------------------------------------------------------
     18 | ERROR | [x] Opening brace should be on the same line as the declaration
     24 | ERROR | [x] Opening brace should be on the same line as the declaration
     27 | ERROR | [x] Expected 1 blank line after function; 0 found
    ---------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/yashaswi/contribs/smart_content_lytics/src/Plugin/smart_content/Condition/Group/Lytics.php
    ------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    ------------------------------------------------------------------------------------------------------
      1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
     17 | ERROR | [x] Opening brace should be on the same line as the declaration
    ------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/yashaswi/contribs/smart_content_lytics/README.md
    ------------------------------------------------------------------------
    FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
    ------------------------------------------------------------------------
      4 | WARNING | [ ] Line exceeds 80 characters; contains 261 characters
      9 | WARNING | [ ] Line exceeds 80 characters; contains 100 characters
     24 | WARNING | [ ] Line exceeds 80 characters; contains 186 characters
     28 | ERROR   | [x] Expected 1 newline at end of file; 0 found
    ------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------
    
    
    FILE: /home/yashaswi/contribs/smart_content_lytics/smart_content_lytics.module
    ------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    ------------------------------------------------------------------------------
      1 | ERROR | [x] Missing file doc comment
      9 | ERROR | [x] Opening brace should be on the same line as the declaration
     11 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
    ------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------
  • Assigned to nitin_lama
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama

    I don't see any remaining issues on 1.0.x branch. Please review.

  • Issue was unassigned.
Production build 0.69.0 2024