Use dependency injection to fix warnings.

Created on 19 December 2024, 5 days ago

Problem/Motivation

Fix warnings reported by PHPCS to use dependency injection.

phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml /home/ide/project/docroot/modules/contrib/media_entity_file_redirect

FILE: /modules/contrib/media_entity_file_redirect/src/Controller/MediaEntityFileRedirectController.php
--------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------
68 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
69 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
--------------------------------------------------------------------------------------------------------

📌 Task
Status

Active

Version

1.1

Component

Code

Created by

🇮🇳India priti197

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024