- Issue created by @ptmkenny
- Status changed to Needs review
9 months ago 4:22pm 30 March 2024 - šÆšµJapan ptmkenny
This fixes all of the coding standards issues identified except 2:
--------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES --------------------------------------------------------------------------------------------- 33 | 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 ---------------------------------------------------------------------------------------------
I think dependency injection can be a separate issue than other coding standard fixes because DI can sometimes cause problems, so it should be a separate commit.
- Status changed to Needs work
5 months ago 12:19pm 31 July 2024 - šµšPhilippines cleavinjosh
Hi @ptmkenny,
I applied MR!8, it was applied smoothly and fixed most of the issues.
However, I encountered more issues than you mentioned in comment #3 after I ran
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml
.ā jsonapi_links git:(1.0.x) curl https://git.drupalcode.org/project/jsonapi_links/-/merge_requests/8.diff | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 3822 0 3822 0 0 9055 0 --:--:-- --:--:-- --:--:-- 9078 patching file README.md patching file src/EventSubscriber/ResponseSubscriber.php patching file src/Form/SettingsForm.php ā jsonapi_links git:(1.0.x) ā .. ā contrib phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml jsonapi_links FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/jsonapi_links/jsonapi_links.routing.yml ------------------------------------------------------------------------------------------------------------ FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------ 7 | ERROR | [x] Expected 1 newline at end of file; 2 found ------------------------------------------------------------------------------------------------------------ PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ------------------------------------------------------------------------------------------------------------ FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/jsonapi_links/jsonapi_links.services.yml ------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------- 5 | ERROR | [x] Expected 1 newline at end of file; 2 found ------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/jsonapi_links/jsonapi_links.links.task.yml --------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE --------------------------------------------------------------------------------------------------------------- 12 | ERROR | [x] Expected 1 newline at end of file; 2 found --------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY --------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/jsonapi_links/src/EventSubscriber/ResponseSubscriber.php ----------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES ----------------------------------------------------------------------------------------------------------------------------- 33 | 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 ----------------------------------------------------------------------------------------------------------------------------- Time: 113ms; Memory: 10MB ā contrib
Please check and advise.
Thank you.