Fix the issues reported by PHPCS

Created on 4 April 2023, over 1 year ago
Updated 23 July 2024, 5 months ago

Problem/Motivation

Fix the issues reported by PHPCS for Drupal and DrupalPractice standards in branch 2.0.x

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig clinic_zymphonies_theme/

Proposed resolution

Fix all the issues listed after executing the command

Remaining tasks

Fixed few issues, the remaining issues are listed below:
FILE: .../web/modules/contrib/clinic_zymphonies_theme/clinic_zymphonies_theme.theme
--------------------------------------------------------------------------------
FOUND 6 ERRORS AND 5 WARNINGS AFFECTING 6 LINES
--------------------------------------------------------------------------------
158 | ERROR | Doc comment short description must be on a single line,
| | further text should be a separate paragraph
278 | WARNING | Translatable strings must not begin or end with white spaces,
| | use placeholders with t() for variables
278 | ERROR | Concatenating translatable strings is not allowed, use
| | placeholders instead and only one string literal
284 | WARNING | Translatable strings must not begin or end with white spaces,
| | use placeholders with t() for variables
284 | ERROR | Concatenating translatable strings is not allowed, use
| | placeholders instead and only one string literal
290 | WARNING | Translatable strings must not begin or end with white spaces,
| | use placeholders with t() for variables
290 | ERROR | Concatenating translatable strings is not allowed, use
| | placeholders instead and only one string literal
295 | WARNING | Translatable strings must not begin or end with white spaces,
| | use placeholders with t() for variables
295 | ERROR | Concatenating translatable strings is not allowed, use
| | placeholders instead and only one string literal
300 | WARNING | Translatable strings must not begin or end with white spaces,
| | use placeholders with t() for variables
300 | ERROR | Concatenating translatable strings is not allowed, use
| | placeholders instead and only one string literal
--------------------------------------------------------------------------------

FILE: ...ntrib/clinic_zymphonies_theme/includes/fontawesome/css/fontawesome.min.css
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
1 | WARNING | File appears to be minified and cannot be processed
--------------------------------------------------------------------------------

FILE: ...ntrib/clinic_zymphonies_theme/includes/smartmenus/jquery.smartmenus.min.js
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
1 | WARNING | File appears to be minified and cannot be processed
--------------------------------------------------------------------------------

FILE: ...odules/contrib/clinic_zymphonies_theme/includes/bootstrap/js/popper.min.js
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
1 | WARNING | File appears to be minified and cannot be processed
--------------------------------------------------------------------------------

FILE: ...les/contrib/clinic_zymphonies_theme/includes/bootstrap/js/bootstrap.min.js
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
1 | WARNING | File appears to be minified and cannot be processed
--------------------------------------------------------------------------------

FILE: ...s/contrib/clinic_zymphonies_theme/includes/bootstrap/css/bootstrap.min.css
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
1 | WARNING | File appears to be minified and cannot be processed
--------------------------------------------------------------------------------

FILE: ...odules/contrib/clinic_zymphonies_theme/includes/bootstrap/css/docs.min.css
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
1 | WARNING | File appears to be minified and cannot be processed
--------------------------------------------------------------------------------

FILE: ...ib/clinic_zymphonies_theme/includes/flexslider/js/jquery.flexslider-min.js
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
1 | WARNING | File appears to be minified and cannot be processed
--------------------------------------------------------------------------------

FILE: ...trib/clinic_zymphonies_theme/includes/owl/assets/owl.theme.default.min.css
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
1 | WARNING | File appears to be minified and cannot be processed
--------------------------------------------------------------------------------

FILE: ...b/modules/contrib/clinic_zymphonies_theme/includes/owl/owl.carousel.min.js
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
1 | WARNING | File appears to be minified and cannot be processed
--------------------------------------------------------------------------------

FILE: ...ribution/drupal8/web/modules/contrib/clinic_zymphonies_theme/css/media.css
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
1 | WARNING | File appears to be minified and cannot be processed
--------------------------------------------------------------------------------

FILE: ...ibution/drupal8/web/modules/contrib/clinic_zymphonies_theme/css/global.css
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
1 | WARNING | File appears to be minified and cannot be processed
--------------------------------------------------------------------------------

Time: 1.42 secs; Memory: 24MB

Please review the patch for fixing few errors and warnings.

šŸ“Œ Task
Status

Needs work

Version

2.0

Component

Code

Created by

šŸ‡®šŸ‡³India urvashi_vora Madhya Pradesh, India

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 @urvashi_vora
  • šŸ‡®šŸ‡³India Anmol_Specbee

    The patch is not working as expected. Moving to "Needs work".

  • šŸ‡®šŸ‡³India Mahima_Mathur23

    Patch applied successfully on Drupal 9.5.7

    @Anmol_Specbee Which version you tried to test it on?
    This module is not compatible with Drupal 10 if that is what you were using.

    Reviewed the patch. It fixed some issues. Attaching the screenshot of the remaining ones.

  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡³India sakthi_dev

    Created a patch for resolve phpcs issue. Please review.

  • šŸ‡®šŸ‡³India rajneeshb New Delhi

    Reviewed #5 patch looks good, +1 for RTBC
    Attaching Screenshot for reference

  • Status changed to Needs work 5 months ago
  • Hi @sakthi_dev,

    The patch you provided was applied successfully, there is only one file that HUNKED at 69(offset 2 lines) and 2 files with 1 warning each were reported. Please see below:

    clinic_zymphonies_theme git:(2.0.1) curl https://www.drupal.org/files/issues/2023-04-20/phpcs-3352106-5.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  106k  100  106k    0     0   233k      0 --:--:-- --:--:-- --:--:--  239k
    patching file clinic_zymphonies_theme.info.yml
    Hunk #1 succeeded at 69 (offset 2 lines).
    patching file clinic_zymphonies_theme.libraries.yml
    patching file clinic_zymphonies_theme.theme
    patching file config/install/clinic_zymphonies_theme.settings.yml
    patching file config/optional/block.block.clinic_zymphonies_theme_page_title.yml
    patching file includes/fontawesome/css/fontawesome-all.css
    patching file includes/owl/assets/owl.carousel.css
    patching file includes/smartmenus/sm-core-css.css
    patching file js/custom.js
    patching file templates/layout/page.html.twig
    āžœ  clinic_zymphonies_theme git:(2.0.1) āœ— cd ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig clinic_zymphonies_theme
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/themes/contrib/clinic_zymphonies_theme/css/global.css
    -----------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------
     1 | WARNING | File appears to be minified and cannot be processed
    -----------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/themes/contrib/clinic_zymphonies_theme/css/media.css
    ----------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------
     1 | WARNING | File appears to be minified and cannot be processed
    ----------------------------------------------------------------------------------------------------------------
    
    Time: 610ms; Memory: 22MB

    Kindly check

    Thanks,
    Jake

Production build 0.71.5 2024