Fix issues reported by PHPCS

Created on 23 January 2025, 7 days 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 solo/

FILE: /var/www/web/themes/contrib/solo/includes/_theme_settings_helper_functions.inc
------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
------------------------------------------------------------------------------------
 529 | WARNING | [x] Empty PHP statement detected: superfluous semicolon.
 540 | WARNING | [x] Empty PHP statement detected: superfluous semicolon.
 551 | WARNING | [x] Empty PHP statement detected: superfluous semicolon.
 569 | WARNING | [x] Empty PHP statement detected: superfluous semicolon.
 585 | WARNING | [x] Empty PHP statement detected: superfluous semicolon.
 655 | WARNING | [ ] Unused variable $key.
------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/solo/includes/_solo_theme_preprocess.inc
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
 353 | WARNING | [x] Empty PHP statement detected: superfluous semicolon.
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: /var/www/web/themes/contrib/solo/theme-settings.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
----------------------------------------------------------------------
 28 | WARNING | Unused variable $d_s.
 29 | WARNING | Unused variable $d_m.
 30 | WARNING | Unused variable $d_l.
 31 | WARNING | Unused variable $updated_regions.
 32 | WARNING | Unused variable $counts.
 33 | WARNING | Unused variable $attributes.
----------------------------------------------------------------------

Time: 7.1 secs; Memory: 26MB

Steps to reproduce

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

Proposed resolution

Fix the PHPCS issues.

šŸ“Œ Task
Status

Active

Version

1.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
  • šŸ‡µšŸ‡­Philippines clarkssquared

    Hi nidhish,

    I applied MR !13 and executed the PHPCS command, these are the only remaining PHPCS issues in the module after I applied your MR

    āžœ  solo git:(main) āœ— curl https://git.drupalcode.org/project/solo/-/merge_requests/13.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  1670    0  1670    0     0   3258      0 --:--:-- --:--:-- --:--:--  3340
    patching file 'includes/_solo_theme_preprocess.inc'
    patching file 'includes/_theme_settings_helper_functions.inc'
    patching file theme-settings.php
    āžœ  solo git:(main) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml solo 
    
    FILE: /Users/clarksubing-subing/Projects/drupal-issues/drupal-project/web/themes/contrib/solo/solo_subtheme/solo_subtheme.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/solo/solo.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: 4.37 secs; Memory: 26MB
    
    āžœ  contrib git:(main) āœ— 
    

    I will leave the decision to the maintainer if this needs to be fixed or no, hence retaining the status to needs review

  • @clarkssquared, The date stamp, version, project warning is coming because of installing dependencies through composer in your local system. It would not appear in the codebase. Kindly check on https://git.drupalcode.org/issue/solo-3501667/-/blob/3501667-fix-issues-... and https://git.drupalcode.org/issue/solo-3501667/-/blob/3501667-fix-issues-..., you would not find date stamp, version, project in code

Production build 0.71.5 2024