Fix the issues reported by phpcs

Created on 25 April 2024, 7 months ago
Updated 11 July 2024, 4 months ago

Problem/Motivation

command -:
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,css,theme,info,txt,md,yml,twig modules/contrib/color

FILE: D:\wamp64\www\drupal10\modules\custom\doissues\color\color.install
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found
   |       |     "\r\n"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: D:\wamp64\www\drupal10\modules\custom\doissues\color\color.module
--------------------------------------------------------------------------------
FOUND 6 ERRORS AND 6 WARNINGS AFFECTING 9 LINES
--------------------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found
     |         |     "\r\n"
   9 | ERROR   | [x] Use statements should be sorted alphabetically. The first
     |         |     wrong one is Drupal\Component\Utility\Bytes.
  87 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
 180 | ERROR   | [ ] Missing parameter type
 311 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
 494 | ERROR   | [ ] The array declaration extends to column 122 (the limit is
     |         |     120). The array content should be split up over multiple
     |         |     lines
 550 | WARNING | [x] There must be no blank line following an inline comment
 550 | WARNING | [ ] There must be no blank line following an inline comment
 689 | WARNING | [x] There must be no blank line following an inline comment
 689 | WARNING | [ ] There must be no blank line following an inline comment
 691 | ERROR   | [x] Inline comments must start with a capital letter
 691 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks,
     |         |     question marks, colons, or closing parentheses
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: D:\wamp64\www\drupal10\modules\custom\doissues\color\css\color.admin.css
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found
   |       |     "\r\n"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...upal10\modules\custom\doissues\color\src\ColorSystemBrandingBlockAlter.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found
    |       |     "\r\n"
 16 | ERROR | [ ] Doc comment short description must start with a capital
    |       |     letter
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...\custom\doissues\color\src\EventSubscriber\ColorConfigCacheInvalidator.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found
   |       |     "\r\n"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...l10\modules\custom\doissues\color\src\Plugin\migrate\destination\Color.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found
   |       |     "\r\n"
 6 | ERROR | [x] Use statements should be sorted alphabetically. The first
   |       |     wrong one is
   |       |     Drupal\Core\Plugin\ContainerFactoryPluginInterface.
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...pal10\modules\custom\doissues\color\src\Plugin\migrate\source\d7\Color.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found
   |       |     "\r\n"
 8 | ERROR | [x] Use statements should be sorted alphabetically. The first
   |       |     wrong one is Drupal\Core\Entity\EntityTypeManagerInterface.
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...ues\color\tests\modules\color_test\themes\color_test_theme\color\color.inc
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
 1 | ERROR   | [x] End of line character is invalid; expected "\n" but found
   |         |     "\r\n"
 8 | WARNING | [ ] Unused variable $info.
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...sues\color\tests\modules\color_test\themes\color_test_theme\css\colors.css
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found
   |       |     "\r\n"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...dules\custom\doissues\color\tests\src\Functional\ColorConfigSchemaTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found
   |       |     "\r\n"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...odules\custom\doissues\color\tests\src\Functional\ColorSafePreviewTest.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found
    |       |     "\r\n"
 53 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
    |       |     question marks, colons, or closing parentheses
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...\drupal10\modules\custom\doissues\color\tests\src\Functional\ColorTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found
   |       |     "\r\n"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...issues\color\tests\src\Functional\Migrate\NoMultilingualReviewPageTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found
   |       |     "\r\n"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...les\custom\doissues\color\tests\src\Kernel\Migrate\d7\MigrateColorTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found
   |       |     "\r\n"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...tom\doissues\color\tests\src\Kernel\Plugin\migrate\source\d7\ColorTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found
   |       |     "\r\n"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 1.78 secs; Memory: 16MB

Steps to reproduce

Run PHPCS on color module.

Proposed resolution

Fixed the coding standards.

Remaining tasks

Submit the patch either MR .

📌 Task
Status

RTBC

Version

1.0

Component

Code

Created by

🇮🇳India amanbtr72

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 @amanbtr72
  • Status changed to Needs review 7 months ago
  • Merge request !12Fixed phpcs issues → (Open) created by amanbtr72
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 5.7
    last update 7 months ago
    9 pass
  • Status changed to Needs work 7 months ago
  • 🇮🇳India chandansha

    In above phpcs command js extension was missing so found issues with js files kindly fix the issues.

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

    FILE: /home/chandansha/docker/testd9/web/modules/custom/color-3443370/preview.js
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     41 | ERROR | [x] Expected 1 newline at end of file; 0 found
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: /home/chandansha/docker/testd9/web/modules/custom/color-3443370/preview.es6.js
    ------------------------------------------------------------------------------------
    FOUND 10 ERRORS AFFECTING 3 LINES
    ------------------------------------------------------------------------------------
     68 | ERROR | [x] Expected 1 space before "-"; 0 found
     68 | ERROR | [x] Expected 1 space after "-"; 0 found
     68 | ERROR | [x] Expected 1 space before "="; 0 found
     68 | ERROR | [x] Expected 1 space after "="; 0 found
     75 | ERROR | [x] Expected 1 space before "-"; 0 found
     75 | ERROR | [x] Expected 1 space after "-"; 0 found
     75 | ERROR | [x] Expected 1 space before "="; 0 found
     75 | ERROR | [x] Expected 1 space after "="; 0 found
     88 | ERROR | [x] Expected 1 space before "-"; 0 found
     88 | ERROR | [x] Expected 1 space after "-"; 0 found
    ------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------
    
    
    FILE: /home/chandansha/docker/testd9/web/modules/custom/color-3443370/color.es6.js
    ----------------------------------------------------------------------------------------------
    FOUND 44 ERRORS AFFECTING 16 LINES
    ----------------------------------------------------------------------------------------------
      30 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
     148 | ERROR | [x] Whitespace found before second semicolon of FOR loop
     157 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
     159 | ERROR | [x] Whitespace found before second semicolon of FOR loop
     168 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
     186 | ERROR | [x] Expected 1 space before "<"; 0 found
     186 | ERROR | [x] Expected 1 space after "<"; 0 found
     186 | ERROR | [x] Expected 1 space before "="; 0 found
     186 | ERROR | [x] Expected 1 space after "="; 0 found
     186 | ERROR | [x] Expected 1 space before ">"; 0 found
     186 | ERROR | [x] Expected 1 space after ">"; 0 found
     186 | ERROR | [x] Expected 1 space before "<"; 0 found
     186 | ERROR | [x] Expected 1 space after "<"; 0 found
     186 | ERROR | [x] Expected 1 space before "/"; 0 found
     186 | ERROR | [x] Expected 1 space after "/"; 0 found
     186 | ERROR | [x] Expected 1 space before ">"; 0 found
     186 | ERROR | [x] Expected 1 space after ">"; 0 found
     188 | ERROR | [x] Expected 1 space before "-"; 0 found
     188 | ERROR | [x] Expected 1 space after "-"; 0 found
     188 | ERROR | [x] Expected 1 space before "-"; 0 found
     188 | ERROR | [x] Expected 1 space after "-"; 0 found
     198 | ERROR | [x] Expected 1 space after first semicolon of FOR loop; newline found
     202 | ERROR | [x] Expected 1 space after second semicolon of FOR loop; newline found
     218 | ERROR | [x] Expected 1 space before "-"; 0 found
     218 | ERROR | [x] Expected 1 space after "-"; 0 found
     218 | ERROR | [x] Expected 1 space before "-"; 0 found
     218 | ERROR | [x] Expected 1 space after "-"; 0 found
     220 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
     221 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
     249 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
     249 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
     276 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
     278 | ERROR | [x] Expected 1 space before "<"; 0 found
     278 | ERROR | [x] Expected 1 space after "<"; 0 found
     278 | ERROR | [x] Expected 1 space before "="; 0 found
     278 | ERROR | [x] Expected 1 space after "="; 0 found
     278 | ERROR | [x] Expected 1 space before ">"; 0 found
     278 | ERROR | [x] Expected 1 space after ">"; 0 found
     280 | ERROR | [x] Expected 1 space before "<"; 0 found
     280 | ERROR | [x] Expected 1 space after "<"; 0 found
     280 | ERROR | [x] Expected 1 space before "/"; 0 found
     280 | ERROR | [x] Expected 1 space after "/"; 0 found
     280 | ERROR | [x] Expected 1 space before ">"; 0 found
     280 | ERROR | [x] Expected 1 space after ">"; 0 found
    ----------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 44 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------
    
    
    FILE: /home/chandansha/docker/testd9/web/modules/custom/color-3443370/tests/modules/color_test/themes/color_test_theme/js/color_test_theme-fontsize.js
    ------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------------------------------------
     10 | ERROR | [x] Expected 1 newline at end of file; 0 found
    ------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/chandansha/docker/testd9/web/modules/custom/color-3443370/color.js
    ----------------------------------------------------------------------------------------------
    FOUND 9 ERRORS AFFECTING 7 LINES
    ----------------------------------------------------------------------------------------------
      23 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
      94 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
     103 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
     132 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
     132 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
     147 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
     147 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
     159 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
     191 | ERROR | [x] Expected 1 newline at end of file; 0 found
    ----------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------
    
    Time: 386ms; Memory: 16MB
    
    
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 5.7
    last update 7 months ago
    9 pass
  • Status changed to Needs review 7 months ago
  • 🇮🇳India amanbtr72

    Fixed remaining JS issues Please review

  • Status changed to RTBC 7 months ago
  • 🇮🇳India chandansha

    I have tested MR 12 and cannot find any phpcs issue so I move forward to RTBC.

  • Issue was unassigned.
Production build 0.71.5 2024