Problem/Motivation

I saw a @todo tag on the LibraryDefinitionsStream class to make dependency injection.

Steps to reproduce

Simply check line 46 on /libraries/src/StreamWrapper/LibraryDefinitionsStream.php

Proposed resolution

Use the "create" function and the other necessary elements to follow Drupal pattern of dependency injection
https://www.hashbangcode.com/article/drupal-9-introduction-services-and-...
https://drupalize.me/topic/dependency-injection

Remaining tasks

Review patch

CommentFileSizeAuthor
#2 3256984-2.patch1.21 KBandregp

Issue fork libraries-3256984

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

andregp created an issue. See original summary.

andregp’s picture

Assigned: andregp » Unassigned
Status: Active » Needs review
StatusFileSize
new1.21 KB

Here is a patch.

tmaiochi’s picture

Assigned: Unassigned » tmaiochi
tmaiochi’s picture

Assigned: tmaiochi » Unassigned
Status: Needs review » Reviewed & tested by the community

Steps performed:
(1) Installed module
(2) Reproduced the issue.
(3) Applied patch.
(4) Code review on changes.
(5) Tested again with patch, issue resolved.

The patch applied correctly dependency injection, and everything work well.

urvashi_vora made their first commit to this issue’s fork.

joseph.olstad’s picture

Great work everyone above, thank you!

joseph.olstad’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.