Closed (fixed)
Project:
Recurly
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
6 Apr 2017 at 14:34 UTC
Updated:
21 Apr 2017 at 18:05 UTC
Jump to comment: Most recent, Most recent file
From Drupal static service container documentation:
Generally, code in Drupal should accept its dependencies via either constructor injection or setter method injection. However, there are cases, particularly in legacy procedural code, where that is infeasible. This class acts as a unified global accessor to arbitrary services within the system in order to ease the transition from procedural code to injected OO code.
Where possible, replace calls to the Drupal static service container with injected calls. An example can be found in this intediff.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | replace_drupal_static-2867438-3.patch | 58.22 KB | adamzimmermann |
Comments
Comment #2
adamzimmermann commentedComment #3
adamzimmermann commentedThis fixes every use of the global
\Drupalobject that I could find. I am getting some errors while testing this, but they don't seem to be related to changes I made. If someone else could give this a spin that would be great. I believe some of the work that was recently done on the 7.x branch with regards to catching errors on signup pages will address some of the issues I was seeing when it is ported to the 8.x branch.Either way, someone familiar with all of the functionality should test this out to make sure I didn't miss any details, as this touches a lot of code.
Comment #4
adamzimmermann commentedComment #6
markdorison