Fix issues reported by PHPCS

Created on 20 January 2025, about 1 month ago

Problem/Motivation

It would be great to address the below minor PHPCS issues :

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

FILE: /var/www/web/themes/contrib/radix/includes/form.theme
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------
 77 | WARNING | Doc comment indicates hook_form_alter() but function signature is "radix_form_alter" instead of "form_form_alter". Did you
    |         | mean hook_form_FORM_ID_alter()?
----------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/src/kits/radix_starterkit/radix_starterkit.starterkit.yml
-------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------
 11 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/src/kits/radix_starterkit/radix_starterkit.libraries.yml
------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------
 61 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/media/media.component.yml
----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------
 35 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/field-comment/field-comment.component.yml
--------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------
 24 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/offcanvas/offcanvas.component.yml
------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------
 109 | ERROR | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/local-tasks/local-tasks.component.yml
----------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------
 14 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/comment/comment.component.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 47 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/fieldset/fieldset.component.yml
----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------
 62 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/progress/progress.component.yml
----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------
 75 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/form-element--radiocheckbox/form-element--radiocheckbox.component.yml
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
 35 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/form-element--label/form-element--label.component.yml
--------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------
 19 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/taxonomy/taxonomy.component.yml
----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------
 74 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/list-group/list-group.component.yml
--------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------
 81 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/radix/components/dropdown-menu/dropdown-menu.component.yml
--------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------
 92 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------

Time: 453ms; Memory: 12MB

Steps to reproduce

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

Proposed resolution

Fix the PHPCS issues.

šŸ“Œ Task
Status

Active

Version

6.0

Component

Code

Created by

šŸ‡®šŸ‡³India abhiyanshu

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 @abhiyanshu
  • Merge request !126fix the phpcs issues ā†’ (Open) created by abhiyanshu
  • Pipeline finished with Success
    about 1 month ago
    Total: 143s
    #400866
  • Pipeline finished with Success
    about 1 month ago
    Total: 137s
    #400878
  • šŸ‡®šŸ‡³India abhiyanshu

    Fixed all the PHPCS issues except for one warning.
    I'll leave this for your decision, or please let me know how you'd like to proceed. Thanks you.

    FILE: /var/www/web/themes/contrib/radix/includes/form.theme
    ----------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------------------------------------
     77 | WARNING | Doc comment indicates hook_form_alter() but function signature is "radix_form_alter" instead of "form_form_alter". Did you
        |         | mean hook_form_FORM_ID_alter()?
    
  • šŸ‡µšŸ‡­Philippines clarkssquared

    Hi abhiyanshu,

    I applied the MR !126 and I can see PHPCS errors aside from the one you mentioned.

    āžœ  radix git:(main) āœ— curl https://git.drupalcode.org/project/radix/-/merge_requests/126.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  8653    0  8653    0     0  13631      0 --:--:-- --:--:-- --:--:-- 13822
    patching file 'components/comment/comment.component.yml'
    patching file 'components/dropdown-menu/dropdown-menu.component.yml'
    patching file 'components/field-comment/field-comment.component.yml'
    patching file 'components/fieldset/fieldset.component.yml'
    patching file 'components/form-element--label/form-element--label.component.yml'
    patching file 'components/form-element--radiocheckbox/form-element--radiocheckbox.component.yml'
    patching file 'components/list-group/list-group.component.yml'
    patching file 'components/local-tasks/local-tasks.component.yml'
    patching file 'components/media/media.component.yml'
    patching file 'components/offcanvas/offcanvas.component.yml'
    patching file 'components/progress/progress.component.yml'
    patching file 'components/taxonomy/taxonomy.component.yml'
    patching file radix.info.yml
    1 out of 1 hunks failed--saving rejects to radix.info.yml.rej
    patching file 'src/kits/radix_starterkit/radix_starterkit.info.yml'
    1 out of 1 hunks failed--saving rejects to 'src/kits/radix_starterkit/radix_starterkit.info.yml.rej'
    patching file 'src/kits/radix_starterkit/radix_starterkit.libraries.yml'
    patching file 'src/kits/radix_starterkit/radix_starterkit.starterkit.yml'
    āžœ  radix git:(main) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml radix 
    
    FILE: /Users/clarksubing-subing/Projects/drupal-issues/drupal-project/web/themes/contrib/radix/radix.info.yml
    -------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------
     1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
     1 | WARNING | Remove "datestamp" 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: /Users/clarksubing-subing/Projects/drupal-issues/drupal-project/web/themes/contrib/radix/includes/block.theme
    ------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------------------
     9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\block_content\BlockContentInterface.
    ------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/clarksubing-subing/Projects/drupal-issues/drupal-project/web/themes/contrib/radix/includes/form.theme
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     77 | WARNING | Doc comment indicates hook_form_alter() but function signature is "radix_form_alter" instead of "form_form_alter". Did you mean hook_form_FORM_ID_alter()?
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/clarksubing-subing/Projects/drupal-issues/drupal-project/web/themes/contrib/radix/src/kits/radix_starterkit/radix_starterkit.info.yml
    --------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------------------
     1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
     1 | WARNING | Remove "datestamp" 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
    --------------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 497ms; Memory: 10MB
    
    āžœ  contrib git:(main) āœ— 
    
  • šŸ‡ŗšŸ‡øUnited States danchadwick Boston
Production build 0.71.5 2024