woocommerce-paypal-payments/modules.local/woocommerce-logging/services.php

24 lines
623 B
PHP
Raw Normal View History

2020-07-01 13:03:21 +03:00
<?php declare(strict_types=1);
/**
* phpcs:disable Inpsyde.CodeQuality.ReturnTypeDeclaration
* phpcs:disable Inpsyde.CodeQuality.ArgumentTypeDeclaration
*/
namespace Inpsyde\Woocommerce\Logging;
use Inpsyde\Woocommerce\Logging\Logger\NullLogger;
use Inpsyde\Woocommerce\Logging\Logger\WooCommerceLogger;
use Psr\Container\ContainerInterface;
return [
'woocommerce.logger.woocommerce' => function (ContainerInterface $container) {
if (!class_exists(\WC_Logger::class)) {
return new NullLogger();
}
return new WooCommerceLogger(
wc_get_logger()
);
},
];