- In classes that use dependency injection, a HookContainer object is passed in as a constructor parameter. Then the class creates a local HookRunner instance:$this->hookRunner = new HookRunner( $hookContainer );
I'm not sure I understand why the HookRunner wouldn't be in the service container itself? Is there a value to instantiating a new instance of the HookRunner for each service?
Add HookRunner to the service container which will make the runner itself injectable into other services.