Closed garethellis36 closed 9 years ago
So as fun an exercise as this was, I realized that it doesn't actually do what I hoped it would because my custom error class has dependency on Logger
and Twig
. Therefore this $this->setInvokableClass('errorHandler', $defaultHandlers["errorHandler"]);
just results in a fatal error when I actually encounter an error in my app because it's not passing in the dependencies. Any suggestions? :-)
I just discovered ServiceManager::setAllowOverride()
which simultaneously solved my problem and ruined my evening. Sorry to bother you!! :)
:)
This PR adds the option to pass in alternatives to the default services, e.g. an error handler. Alternatives are passed as second constructor argument as an associative array.