Drupal calls should be avoided, use dependency injection

Created on 17 April 2023, over 1 year ago
Updated 20 April 2023, over 1 year ago

Problem/Motivation

FILE: ..._transparency/src/PathProcessor/HospitalPriceTransparencyPathProcessor.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------
22 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
35 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
42 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
--------------------------------------------------------------------------------

FILE: ..._price_transparency/src/Controller/HospitalPriceTransparencyController.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
22 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
--------------------------------------------------------------------------------

Time: 762ms; Memory: 10MB

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

Proposed resolution

Add dependency injection

Remaining tasks

Patch Review and fix remaining issues.

FILE: ..._transparency/src/PathProcessor/HospitalPriceTransparencyPathProcessor.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
61 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
--------------------------------------------------------------------------------

FILE: ..._price_transparency/src/Controller/HospitalPriceTransparencyController.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
22 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
--------------------------------------------------------------------------------

Time: 590ms; Memory: 10MB

📌 Task
Status

Closed: outdated

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

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024