Skip to content

Commit

Permalink
Add WC_Logger_Interface to Logger service to make it backward compati…
Browse files Browse the repository at this point in the history
…ble (#7623)
  • Loading branch information
zmaglica authored Nov 3, 2023
1 parent 329eff8 commit 31834df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Replaced the concrete logging class with a logger interface
10 changes: 5 additions & 5 deletions src/Internal/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand All @@ -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;
Expand Down

0 comments on commit 31834df

Please sign in to comment.