Skip to content
Browse files

Checks if a logger callable has been set before using it.

  • Loading branch information...
1 parent f7e23db commit 047c047ba4650702b7393a33866f2385d4be6ff6 @jhuet jhuet committed Nov 24, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/DoctrineMongoODMModule/Service/ConfigurationFactory.php
View
8 src/DoctrineMongoODMModule/Service/ConfigurationFactory.php
@@ -47,9 +47,11 @@ public function createService(ServiceLocatorInterface $serviceLocator)
$config = new Configuration;
// the logger with an injection of the service locator as a 2nd argument
- $config->setLoggerCallable(function(array $log) use ($options, $serviceLocator) {
- call_user_func_array($options->getLoggerCallable(), array($log, $serviceLocator));
- });
+ if (is_callable($options->getLoggerCallable())) {
+ $config->setLoggerCallable(function(array $log) use ($options, $serviceLocator) {
+ call_user_func_array($options->getLoggerCallable(), array($log, $serviceLocator));
+ });
+ }
// proxies
$config->setAutoGenerateProxyClasses($options->getGenerateProxies());

0 comments on commit 047c047

Please sign in to comment.
Something went wrong with that request. Please try again.