Coding Standards PHPCS

Created on 28 June 2023, over 1 year ago
Updated 20 August 2024, 3 months ago
FILE: /var/www/html/drupal8/web/modules/field_pager/src/Plugin/Field/FieldFormatter/EntityReferenceRevisionsPager.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 70 | ERROR | [ ] The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get($index_name) instead
 70 | ERROR | [x] Use null coalesce operator instead of ternary operator.
 70 | ERROR | [ ] The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get($index_name) instead
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal8/web/modules/field_pager/src/Plugin/Field/FieldFormatter/FieldTextPager.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 65 | ERROR | [ ] The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get($index_name) instead
 65 | ERROR | [x] Use null coalesce operator instead of ternary operator.
 65 | ERROR | [ ] The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get($index_name) instead
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal8/web/modules/field_pager/src/Plugin/Field/FieldFormatter/FieldBasePager.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 57 | ERROR | [ ] The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get($index_name) instead
 57 | ERROR | [x] Use null coalesce operator instead of ternary operator.
 57 | ERROR | [ ] The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get($index_name) instead
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal8/web/modules/field_pager/src/Plugin/Field/FieldFormatter/EntityReferencePager.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 70 | ERROR | [ ] The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get($index_name) instead
 70 | ERROR | [x] Use null coalesce operator instead of ternary operator.
 70 | ERROR | [ ] The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get($index_name) instead
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal8/web/modules/field_pager/src/Plugin/Field/FieldFormatter/FieldImagePager.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 93 | ERROR | [ ] The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get($index_name) instead
 93 | ERROR | [x] Use null coalesce operator instead of ternary operator.
 93 | ERROR | [ ] The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get($index_name) instead
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal8/web/modules/field_pager/src/PagerHelper.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 101 | ERROR | [ ] The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get($index_name) instead
 101 | ERROR | [x] Use null coalesce operator instead of ternary operator.
 101 | ERROR | [ ] The $_GET super global must not be accessed directly; inject the request_stack service and use $stack->getCurrentRequest()->query->get($index_name) instead
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
šŸ“Œ Task
Status

Needs work

Version

1.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @Neeraj333
  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡³India Jaspreet-Kaur

    Verified patch #2 implemented successfully with o error and warning!

  • Status changed to Needs work 3 months ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @Neeraj333,

    I applied patch #2, it was applied smoothly and fixed most of the phpcs issues.

    These are the remaining issues after I ran phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml:

    āžœ  field_pager git:(8.x-1.x) curl https://www.drupal.org/files/issues/2023-06-28/fix_coding_standard-3370940-2.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  9514  100  9514    0     0  18085      0 --:--:-- --:--:-- --:--:-- 18087
    patching file src/PagerHelper.php
    patching file src/Plugin/Field/FieldFormatter/EntityReferencePager.php
    patching file src/Plugin/Field/FieldFormatter/EntityReferenceRevisionsPager.php
    patching file src/Plugin/Field/FieldFormatter/FieldBasePager.php
    patching file src/Plugin/Field/FieldFormatter/FieldImagePager.php
    patching file src/Plugin/Field/FieldFormatter/FieldTextPager.php
    āžœ  field_pager git:(8.x-1.x) āœ— ..
    āžœ  contrib phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml field_pager
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/field_pager/field_pager.info.yml
    -----------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------
     1 | WARNING | "core_version_requirement" property is missing in the info.yml file
    -----------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/field_pager/src/Plugin/Field/FieldFormatter/FieldBasePager.php
    -----------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Field\FieldItemListInterface.
    -----------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/field_pager/src/Plugin/Field/FieldFormatter/FieldTextPager.php
    ----------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------------------------------
     10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Symfony\Component\HttpFoundation\RequestStack.
    ----------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/field_pager/src/Plugin/Field/FieldFormatter/EntityReferencePager.php
    -----------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Field\FieldItemListInterface.
    -----------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/field_pager/src/Plugin/Field/FieldFormatter/FieldImagePager.php
    ------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------------------
     8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
    ------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/field_pager/src/Plugin/Field/FieldFormatter/EntityReferenceRevisionsPager.php
    --------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Field\FieldItemListInterface.
    --------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 273ms; Memory: 10MB
    
    āžœ  contrib

    Thank you.

Production build 0.71.5 2024