Fix the issues reported by phpcs

Created on 3 February 2023, over 2 years ago
Updated 18 July 2024, 11 months ago
๐Ÿ“Œ Task
Status

Needs work

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia jay jangid Jaipur

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.

  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @jay jangid
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia jay jangid Jaipur

    Created MR , please review.

    Thank you.

  • Issue was unassigned.
  • Status changed to Needs work about 2 years ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
    -    // Be pesimistic about getting a type
    +    // Be pesimistic about getting a type.

    pesimistic is misspelled.

    Out of curiosity: Why was not the DrupalPractice standard used?

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia zkhan.aamir

    zkhan.aamir โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia zkhan.aamir

    I have used command
    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig virtual_events/

  • First commit to issue fork.
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    The warnings/errors are for 17 files, but the MR changes 13 files. It seems there are still four files to change.

  • First commit to issue fork.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sakthi_dev

    Fixed some PHPCS issues, still there are \Drupal calls error that needs to be fixed.

    FILE: .../contribution/virtual_events/src/Form/VirtualEventsFormatterEntityForm.php
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 5 LINES
    --------------------------------------------------------------------------------
     38 | WARNING | \Drupal calls should be avoided in classes, use dependency
        |         | injection instead
     39 | WARNING | \Drupal calls should be avoided in classes, use dependency
        |         | injection instead
     40 | WARNING | Unused variable $allBundles.
     40 | WARNING | \Drupal calls should be avoided in classes, use dependency
        |         | injection instead
     42 | WARNING | Unused variable $sources.
     43 | WARNING | \Drupal calls should be avoided in classes, use dependency
        |         | injection instead
    --------------------------------------------------------------------------------
    
    
    FILE: ...cts/contribution/virtual_events/src/Form/VirtualEventsConfigEntityForm.php
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 6 LINES
    --------------------------------------------------------------------------------
     18 | WARNING | \Drupal calls should be avoided in classes, use dependency
        |         | injection instead
     19 | WARNING | \Drupal calls should be avoided in classes, use dependency
        |         | injection instead
     20 | WARNING | \Drupal calls should be avoided in classes, use dependency
        |         | injection instead
     24 | WARNING | Unused variable $formBuilder.
     24 | WARNING | \Drupal calls should be avoided in classes, use dependency
        |         | injection instead
     26 | WARNING | Unused variable $pluginConfigForms.
     33 | WARNING | \Drupal calls should be avoided in classes, use dependency
        |         | injection instead
    --------------------------------------------------------------------------------
    
    
    FILE: ...ts/contribution/virtual_events/src/Services/VirtualEventsCommonService.php
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     46 | WARNING | \Drupal calls should be avoided in classes, use dependency
        |         | injection instead
    --------------------------------------------------------------------------------
    
  • Assigned to Neha-Verma
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work 11 months ago
  • Hi @Neha-Verma,

    The latest changes in MR!3 was applied not-so successfully, might be the reason errors are still reported. Please see below:

    virtual_events git:(1.0.x) curl https://git.drupalcode.org/project/virtual_events/-/merge_requests/3.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 30596    0 30596    0     0  76725      0 --:--:-- --:--:-- --:--:-- 79885
    patching file src/Controller/VirtualEventsEventEndedController.php
    patching file src/Entity/VirtualEventsConfigEntity.php
    patching file src/Entity/VirtualEventsEventEntity.php
    patching file src/Form/VirtualEventsConfigEntityForm.php
    patching file src/Form/VirtualEventsFormatterEntityForm.php
    patching file src/Plugin/VirtualEventFormatterPluginBase.php
    patching file src/Plugin/VirtualEventFormatterPluginManager.php
    patching file src/Plugin/VirtualEventPostHandlePluginBase.php
    patching file src/Plugin/VirtualEventPostHandlePluginManager.php
    patching file src/Plugin/VirtualEventPreHandlePluginBase.php
    patching file src/Plugin/VirtualEventPreHandlePluginManager.php
    patching file src/Plugin/VirtualEventSourcePluginBase.php
    patching file src/Plugin/VirtualEventSourcePluginManager.php
    patching file src/Services/VirtualEventsCommonService.php
    Hunk #3 FAILED at 54.
    Hunk #4 succeeded at 81 (offset 4 lines).
    Hunk #5 succeeded at 114 (offset 4 lines).
    1 out of 5 hunks FAILED -- saving rejects to file src/Services/VirtualEventsCommonService.php.rej
    patching file src/VirtualEventsUninstallValidator.php
    patching file virtual_events.module
    patching file virtual_events.routing.yml
    โžœ  virtual_events git:(1.0.x) โœ— cd ..
    โžœ  contrib git:(master) โœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig virtual_events
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/virtual_events/src/Form/VirtualEventsConfigEntityForm.php
    -------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------
     59 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
    -------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/virtual_events/src/Services/VirtualEventsCommonService.php
    --------------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
    --------------------------------------------------------------------------------------------------------------------------------------
     57 | ERROR   | [x] Whitespace found at end of line
     59 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
     69 | ERROR   | [x] Whitespace found at end of line
    --------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 1.06 secs; Memory: 12MB

    Kindly check

    Thanks,
    Jake

  • Pipeline finished with Success
    11 months ago
    Total: 143s
    #228027
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
Production build 0.71.5 2024