Add EntityTypeManager in the dependency injection instead of Media directly

Created on 5 February 2023, over 1 year 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.69.0 2024