You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Currently while wiring the classes we are instantiating dependencies.
However, this is something we should not do cause it moves the instantiation from dependencies inside the service provider and not anymore inside the definition.
The main difference here being that the definition is called when the actual is needing for instantiation and not when the whole provider needs to be registered.
To Reproduce
Use Xdebug
Go to any provider
Check when the dependency is instantiated
Removed the $this->getContainer()->get on the dependency
Check when the dependency is instantiated
Expected behavior
Developers should pass dependencies this way:
Describe the bug
Currently while wiring the classes we are instantiating dependencies.
However, this is something we should not do cause it moves the instantiation from dependencies inside the service provider and not anymore inside the definition.
The main difference here being that the definition is called when the actual is needing for instantiation and not when the whole provider needs to be registered.
To Reproduce
Use Xdebug
$this->getContainer()->get
on the dependencyExpected behavior
Developers should pass dependencies this way:
instead of:
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Acceptance Criteria (for WP Media team use only)
Clear instructions for developers, to be added before the grooming
The text was updated successfully, but these errors were encountered: