Fix the issues reported by phpcs

Created on 3 June 2023, over 1 year ago
Updated 17 July 2024, 4 months ago

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

FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/feeds_ldap/feeds_ldap.install
------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------

FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/feeds_ldap/src/Feeds/Fetcher/Form/QueryFetcherFeedForm.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------
8 | WARNING | [x] Unused use statement
28 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------

FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/feeds_ldap/src/Feeds/Fetcher/QueryFetcher.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
9 | WARNING | [x] Unused use statement
50 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
62 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------

FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/feeds_ldap/src/Feeds/Result/QueryFetcherResult.php
---------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------
15 | ERROR | [x] Expected "" but found "???" for @var tag in member variable comment
---------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------

FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/feeds_ldap/feeds_ldap.info.yml
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------
7 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
8 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
9 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
----------------------------------------------------------------------------------------------

šŸ“Œ Task
Status

Needs work

Version

4.0

Component

Code

Created by

šŸ‡®šŸ‡³India arti_parmar

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 @arti_parmar
  • Status changed to Needs work over 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    Since PHP_CodeSniffer is used, the issue summary should show the complete report given by phpcs, not part of it.

  • Issue was unassigned.
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • šŸ‡®šŸ‡³India arpitk

    Hi I have created a patch with some fixes. Few more issues need to be worked on. Please review.

    remaining issues

    FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/feeds_ldap/feeds_ldap.install
    ------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------
    1 | ERROR | [x] Missing file doc comment
    ------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------

    FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/feeds_ldap/src/Feeds/Fetcher/Form/QueryFetcherFeedForm.php
    -----------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------
    8 | WARNING | [x] Unused use statement
    -----------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------

    FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/feeds_ldap/src/Feeds/Fetcher/QueryFetcher.php
    ----------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------
    9 | WARNING | [x] Unused use statement
    ----------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------

    FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/feeds_ldap/src/Feeds/Result/QueryFetcherResult.php
    ---------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------
    15 | ERROR | [x] Expected "" but found "???" for @var tag in member variable comment
    ---------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------

    FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/feeds_ldap/feeds_ldap.info.yml
    ----------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    ----------------------------------------------------------------------------------------------
    7 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
    8 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
    9 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
    ----------------------------------------------------------------------------------------------
    Thanks!

  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Assigned to arti_parmar
  • Issue was unassigned.
  • Status changed to Needs work 4 months ago
  • Hi @arpitk,

    The patch you provided was applied successfully, but there are still errors reported. Please see below:

    feeds_ldap git:(4.0.x) curl https://www.drupal.org/files/issues/2023-06-08/3364585-12.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  2339  100  2339    0     0   7212      0 --:--:-- --:--:-- --:--:--  7425
    patching file src/Feeds/Fetcher/Form/QueryFetcherFeedForm.php
    patching file src/Feeds/Fetcher/QueryFetcher.php
    āžœ  feeds_ldap git:(4.0.x) āœ— cd ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig feeds_ldap
    
    FILE: ...-site/drupal-orgissue-v9/web/modules/contrib/feeds_ldap/feeds_ldap.install
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     1 | ERROR | [x] Missing file doc comment
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...site/drupal-orgissue-v9/web/modules/contrib/feeds_ldap/feeds_ldap.info.yml
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    --------------------------------------------------------------------------------
     7 | WARNING | All dependencies must be prefixed with the project name, for
       |         | example "drupal:"
     8 | WARNING | All dependencies must be prefixed with the project name, for
       |         | example "drupal:"
     9 | WARNING | All dependencies must be prefixed with the project name, for
       |         | example "drupal:"
    --------------------------------------------------------------------------------
    
    
    FILE: ...modules/contrib/feeds_ldap/src/Feeds/Fetcher/Form/QueryFetcherFeedForm.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    --------------------------------------------------------------------------------
     6 | ERROR   | [x] Use statements should be sorted alphabetically. The first
       |         |     wrong one is Drupal\Core\Form\FormStateInterface.
     8 | WARNING | [x] Unused use statement
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...issue-v9/web/modules/contrib/feeds_ldap/src/Feeds/Fetcher/QueryFetcher.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    --------------------------------------------------------------------------------
     8 | ERROR   | [x] Use statements should be sorted alphabetically. The first
       |         |     wrong one is Drupal\feeds\Plugin\Type\PluginBase.
     9 | WARNING | [x] Unused use statement
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...rgissue-v9/web/modules/contrib/feeds_ldap/src/Feeds/Parser/EntryParser.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\feeds\Result\ParserResult.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    Time: 198ms; Memory: 10MB

    Kindly check

    Thanks,
    Jake

Production build 0.71.5 2024