- Issue created by @jay jangid
- Merge request !3Issue #3338858: Drupal Coding Standards Issues | phpcs โ (Open) created by jay jangid
- ๐ฎ๐ณIndia jay jangid Jaipur
Created MR , please review.
Thank you.
- Issue was unassigned.
- Status changed to Needs work
over 1 year ago 11:55am 1 May 2023 - ๐ฎ๐น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, ๐ฎ๐น
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
about 1 year ago 6:57am 18 December 2023 - Status changed to Needs work
5 months ago 11:55pm 17 July 2024 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