Skip to content

Commit

Permalink
Checks if a logger callable has been set before using it.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhuet committed Nov 24, 2012
1 parent f7e23db commit 047c047
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/DoctrineMongoODMModule/Service/ConfigurationFactory.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ public function createService(ServiceLocatorInterface $serviceLocator)
$config = new Configuration; $config = new Configuration;


// the logger with an injection of the service locator as a 2nd argument // the logger with an injection of the service locator as a 2nd argument
$config->setLoggerCallable(function(array $log) use ($options, $serviceLocator) { if (is_callable($options->getLoggerCallable())) {
call_user_func_array($options->getLoggerCallable(), array($log, $serviceLocator)); $config->setLoggerCallable(function(array $log) use ($options, $serviceLocator) {
}); call_user_func_array($options->getLoggerCallable(), array($log, $serviceLocator));
});
}


// proxies // proxies
$config->setAutoGenerateProxyClasses($options->getGenerateProxies()); $config->setAutoGenerateProxyClasses($options->getGenerateProxies());
Expand Down

0 comments on commit 047c047

Please sign in to comment.