Updating setupLogger to use classname as string

- `:class` not allowed in PHP 5.3 and 5.4
This commit is contained in:
Jay Patel
2016-04-06 14:22:33 -05:00
parent 69886a0741
commit 557fb3718f

View File

@@ -87,7 +87,7 @@ class PayPalLoggingManager
private function setupLogger($config = array()) {
// Checks if custom adapter defined, and is it an implementation of @LoggerInterface
$loggingAdapter = array_key_exists('log.Adapter', $config) && in_array(LoggerInterface::class, class_implements($config['log.Adapter']))? $config['log.Adapter'] : PayPalLogger::class;
$loggingAdapter = array_key_exists('log.Adapter', $config) && in_array('\Psr\Log\LoggerInterface', class_implements($config['log.Adapter']))? $config['log.Adapter'] : '\PayPal\Log\PayPalLogger';
$this->logger = new $loggingAdapter();
}