Fix the issues reported by phpcs

Created on 29 March 2023, almost 2 years ago
Updated 9 July 2024, 7 months ago

Problem/Motivation

Resolve the PHP Coding standard issue.

FILE: /var/www/html/modules/contrib/jquery_countdown_timer/src/Plugin/Block/JqueryCountdownTimerBlock.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Non-namespaced classes/interfaces/traits should not be referenced with use statements
28 | ERROR | [ ] The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
-----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------

Time: 148ms; Memory: 6MB

Steps to reproduce

Run the Code sniffer
Run the phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/jquery_countdown_timer/

Proposed resolution

Resolve the PHPCS issues.

Remaining tasks

User interface changes

API changes

Data model changes

šŸ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

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 @mukesh88
  • First commit to issue fork.
  • Status changed to Needs review almost 2 years ago
  • šŸ‡®šŸ‡³India _pratik_ Banglore
  • Issue was unassigned.
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @_pratik_,

    I applied MR!1 and it was applied cleanly. However, I still encountered some issues after I ran phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml.

    āžœ  jquery_countdown_timer git:(8.x-1.4) curl https://git.drupalcode.org/project/jquery_countdown_timer/-/merge_requests/1.diff | git apply -v
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  1053    0  1053    0     0   2246      0 --:--:-- --:--:-- --:--:--  2245
    Checking patch src/Plugin/Block/JqueryCountdownTimerBlock.php...
    Applied patch src/Plugin/Block/JqueryCountdownTimerBlock.php cleanly.
    āžœ  jquery_countdown_timer git:(8.x-1.4) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml jquery_countdown_timer
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/jquery_countdown_timer/README.md
    -----------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------
     39 | ERROR | [x] Expected 1 newline at end of file; 0 found
    -----------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/jquery_countdown_timer/src/Plugin/Block/JqueryCountdownTimerBlock.php
    ------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Datetime\DrupalDateTime.
    ------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 155ms; Memory: 10MB
    
    āžœ  contrib git:(main) āœ—

    Please check and advise.
    Thank you.

  • Status changed to Needs work 7 months ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh
  • First commit to issue fork.
  • Status changed to Needs review 7 months ago
  • Status changed to RTBC 7 months ago
  • šŸ‡®šŸ‡³India abhiyanshu

    I have thoroughly reviewed MR !1 and can confirm that it resolves all the PHPCS issues.
    For additional clarity, please refer to the attached screenshot. Excellent work on this!
    Moving it to RTBC. Thanks!

Production build 0.71.5 2024