Fix issues reported by PHPCS

Created on 1 March 2023, over 1 year ago
Updated 15 August 2024, 3 months ago

Problem/Motivation

Theme doesn't follow proper coding standards as per Drupal and DrupalPractice.

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 star_zymphonies_theme/

Proposed resolution

Fix all the issues.

šŸ“Œ Task
Status

Needs work

Version

1.0

Component

Code

Created by

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

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

Comments & Activities

  • Issue created by @urvashi_vora
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡³India urvashi_vora Madhya Pradesh, India

    Fixed some issues and creating an MR. Please review.

    Thanks

  • @urvashi_vora opened merge request.
  • Assigned to annmarysruthy
  • Issue was unassigned.
  • Status changed to Needs work 3 months ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @urvashi_vora,

    I applied MR!1, it was applied smoothly and fixed most of the phpcs.

    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:

    āžœ  star_zymphonies_theme git:(1.0.x) curl https://git.drupalcode.org/project/star_zymphonies_theme/-/merge_requests/1.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  137k    0  137k    0     0   274k      0 --:--:-- --:--:-- --:--:--  274k
    patching file config/install/star_zymphonies_theme.settings.yml
    patching file config/optional/block.block.star_zymphonies_theme_page_title.yml
    patching file css/global.css
    patching file css/media.css
    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 star_zymphonies_theme.libraries.yml
    patching file star_zymphonies_theme.theme
    patching file templates/layout/page.html.twig
    āžœ  star_zymphonies_theme git:(1.0.x) āœ— ..
    āžœ  contrib phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml star_zymphonies_theme
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/themes/contrib/star_zymphonies_theme/includes/smartmenus/sm-core-css.css
    -----------------------------------------------------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    -----------------------------------------------------------------------------------------------------------------------------
      69 | ERROR | Style definitions must end with a semicolon
      75 | ERROR | Style definitions must end with a semicolon
     112 | ERROR | Style definitions must end with a semicolon
    -----------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/themes/contrib/star_zymphonies_theme/star_zymphonies_theme.theme
    -----------------------------------------------------------------------------------------------------------------------------
    FOUND 7 ERRORS AND 5 WARNINGS AFFECTING 7 LINES
    -----------------------------------------------------------------------------------------------------------------------------
     113 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
     147 | ERROR   | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
     262 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
     262 | ERROR   | [ ] Concatenating translatable strings is not allowed, use placeholders instead and only one string literal
     268 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
     268 | ERROR   | [ ] Concatenating translatable strings is not allowed, use placeholders instead and only one string literal
     274 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
     274 | ERROR   | [ ] Concatenating translatable strings is not allowed, use placeholders instead and only one string literal
     279 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
     279 | 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
    -----------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------
    
    Time: 663ms; Memory: 24MB
    
    āžœ  contrib

    Thank you.

Production build 0.71.5 2024