diff --git a/changelog/hotfix-use-logger-interface-instead-of-concrete-logger-class b/changelog/hotfix-use-logger-interface-instead-of-concrete-logger-class new file mode 100644 index 00000000000..10a864550b2 --- /dev/null +++ b/changelog/hotfix-use-logger-interface-instead-of-concrete-logger-class @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Replaced the concrete logging class with a logger interface diff --git a/src/Internal/Logger.php b/src/Internal/Logger.php index 5373b921011..517f9f2fd6d 100644 --- a/src/Internal/Logger.php +++ b/src/Internal/Logger.php @@ -8,8 +8,8 @@ namespace WCPay\Internal; use Exception; -use WC_Logger; use WC_Log_Levels; +use WC_Logger_Interface; use WC_Payment_Gateway_WCPay; use WCPay\Core\Mode; @@ -21,9 +21,9 @@ class Logger { const LOG_FILENAME = 'woocommerce-payments'; /** - * The holding property for our WC_Logger instance. + * The holding property for our WC_Logger_Interface instance. * - * @var WC_Logger $logger + * @var WC_Logger_Interface $logger */ private $wc_logger; @@ -44,11 +44,11 @@ class Logger { /** * Logger constructor. * - * @param WC_Logger $wc_logger WC_Logger. + * @param WC_Logger_Interface $wc_logger WC_Logger_Interface. * @param Mode $mode Mode. * @param WC_Payment_Gateway_WCPay $gateway WC_Payment_Gateway_WCPay. */ - public function __construct( WC_Logger $wc_logger, Mode $mode, WC_Payment_Gateway_WCPay $gateway ) { + public function __construct( WC_Logger_Interface $wc_logger, Mode $mode, WC_Payment_Gateway_WCPay $gateway ) { $this->wc_logger = $wc_logger; $this->mode = $mode; $this->gateway = $gateway;