Fix coding standards

Created on 6 July 2023, over 1 year ago
FILE: .module
----------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------
 11 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
    |       |     Drupal\index_now\NodeOperations.
----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------


FILE: /tests/src/Unit/NodeOperationsTest.php
----------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------
 12 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
    |       |     Drupal\Tests\UnitTestCase.
----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------


FILE: /tests/src/Unit/TermOperationsTest.php
----------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------
 9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
   |       |     Drupal\index_now\Service\IndexNowInterface.
----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------


FILE: /tests/src/Kernel/IndexNowKeyManagerTest.php
--------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------
  6 | WARNING | [x] Unused use statement
 55 | ERROR   | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------


FILE: .install
------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
------------------------------------------------------------------------
  1 | ERROR   | [x] Missing file doc comment
 15 | WARNING | [ ] Unused variable $api_key.
------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------


FILE: /src/Service/IndexNow.php
-------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------
  99 | WARNING | Only string literals should be passed to t() where possible
 107 | WARNING | Only string literals should be passed to t() where possible
-------------------------------------------------------------------------------


FILE: /src/Form/ModuleSettingsForm.php
--------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------------
 248 | WARNING | #options values usually have to run through t() for translation
 249 | WARNING | #options values usually have to run through t() for translation
 250 | WARNING | #options values usually have to run through t() for translation
 251 | WARNING | #options values usually have to run through t() for translation
--------------------------------------------------------------------------------------

As explained in this comment 📌 Fix the Coding standards reported by phpcs Fixed we won't fix the following warnings for the same reasons:

FILE: /src/Service/IndexNow.php
-------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------
  99 | WARNING | Only string literals should be passed to t() where possible
 107 | WARNING | Only string literals should be passed to t() where possible
-------------------------------------------------------------------------------


FILE: /src/Form/ModuleSettingsForm.php
--------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------------
 248 | WARNING | #options values usually have to run through t() for translation
 249 | WARNING | #options values usually have to run through t() for translation
 250 | WARNING | #options values usually have to run through t() for translation
 251 | WARNING | #options values usually have to run through t() for translation
--------------------------------------------------------------------------------------
📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇫🇷France MacSim

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

Comments & Activities

  • Issue created by @MacSim
  • Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    Not currently mergeable.
  • @macsim opened merge request.
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    13 pass
  • Status changed to Needs review over 1 year ago
  • 🇫🇷France MacSim

    Tests are ok on the MR (I fixed a typo in 2 functions name in the tests).

    Running PHPCS only returns the warnings we didn't wanted to fix.

    FILE: /src/Service/IndexNow.php
    -------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    -------------------------------------------------------------------------------
      99 | WARNING | Only string literals should be passed to t() where possible
     107 | WARNING | Only string literals should be passed to t() where possible
    -------------------------------------------------------------------------------
    
    
    FILE: src/Form/ModuleSettingsForm.php
    --------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    --------------------------------------------------------------------------------------
     248 | WARNING | #options values usually have to run through t() for translation
     249 | WARNING | #options values usually have to run through t() for translation
     250 | WARNING | #options values usually have to run through t() for translation
     251 | WARNING | #options values usually have to run through t() for translation
    --------------------------------------------------------------------------------------
    
  • Status changed to Fixed over 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024