Add EntityTypeManager in the dependency injection instead of Media directly

Created on 5 February 2023, almost 2 years ago

Problem/Motivation

I saw that on classes to Generate JS and Generate CSS we're using Media class directly, which works, but there is a best practice to use dependency injection instead because it'll improve the maintainability

Steps to reproduce

We can run the phpcs to verify the DrupalPractice standard, the result: WARNING | Media::load calls should be avoided in classes, use dependency injection instead

Proposed resolution

Declare the entityTypeManager in the services, protected property in the class to generate JSS and styles, and use object $this

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.4

Component

Code

Created by

🇧🇷Brazil renatog Campinas

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

Comments & Activities

Production build 0.71.5 2024