From a9460ef4a854a23900ca62138c71c6950abd21dd Mon Sep 17 00:00:00 2001 From: Alex Komarichev Date: Wed, 18 Sep 2024 19:37:15 +0300 Subject: [PATCH] Tests --- src/include/components/class-wc-retailcrm-logger.php | 2 +- src/include/customer/class-wc-retailcrm-customer-address.php | 2 +- .../customer/class-wc-retailcrm-customer-corporate-address.php | 2 +- .../models/class-wc-retailcrm-customer-switcher-result.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/include/components/class-wc-retailcrm-logger.php b/src/include/components/class-wc-retailcrm-logger.php index 6682108..424ffc0 100644 --- a/src/include/components/class-wc-retailcrm-logger.php +++ b/src/include/components/class-wc-retailcrm-logger.php @@ -217,7 +217,7 @@ if (!class_exists('WC_Retailcrm_Logger') && class_exists('WC_Log_Levels')) : ]; } - return method_exists($object, 'get_data') ? (array_filter($object->get_data())) : $object; + return method_exists($object, 'get_data') ? (array_filter($object->get_data())) : [$object]; } } endif; diff --git a/src/include/customer/class-wc-retailcrm-customer-address.php b/src/include/customer/class-wc-retailcrm-customer-address.php index 04e3d51..82fa313 100644 --- a/src/include/customer/class-wc-retailcrm-customer-address.php +++ b/src/include/customer/class-wc-retailcrm-customer-address.php @@ -35,7 +35,7 @@ class WC_Retailcrm_Customer_Address extends WC_Retailcrm_Abstracts_Address } else { WC_Retailcrm_Logger::error( __METHOD__, - sprintf('Error: Customer %s address is empty', $customer->getId()), + 'Error: Customer address is empty', null, ['wc_customer' => WC_Retailcrm_Logger::formatWCObject($customer)] ); diff --git a/src/include/customer/class-wc-retailcrm-customer-corporate-address.php b/src/include/customer/class-wc-retailcrm-customer-corporate-address.php index 47befa5..12d3959 100644 --- a/src/include/customer/class-wc-retailcrm-customer-corporate-address.php +++ b/src/include/customer/class-wc-retailcrm-customer-corporate-address.php @@ -53,7 +53,7 @@ class WC_Retailcrm_Customer_Corporate_Address extends WC_Retailcrm_Abstracts_Add } else { WC_Retailcrm_Logger::error( __METHOD__, - sprintf('Error: Corporate Customer %s address is empty.', $customer->get_id()), + 'Error: Corporate Customer address is empty.', null, ['wc_customer' => WC_Retailcrm_Logger::formatWCObject($customer)] ); diff --git a/src/include/models/class-wc-retailcrm-customer-switcher-result.php b/src/include/models/class-wc-retailcrm-customer-switcher-result.php index 1183148..a4bc49b 100644 --- a/src/include/models/class-wc-retailcrm-customer-switcher-result.php +++ b/src/include/models/class-wc-retailcrm-customer-switcher-result.php @@ -65,7 +65,7 @@ class WC_Retailcrm_Customer_Switcher_Result { WC_Retailcrm_Logger::info( __METHOD__, - sprintf('Saving WC_Customer %s and WC_Order %s', $this->wcCustomer->get_id(), $this->wcOrder->get_id()), + 'Saving WC_Customer and WC_Order', null, [ 'wc_customer' => WC_Retailcrm_Logger::formatWCObject($this->wcCustomer),