1
0
mirror of synced 2025-02-07 02:29:23 +03:00

Fix PHP warning and deprecated

This commit is contained in:
Dima Uryvskiy 2021-10-27 19:14:38 +03:00 committed by GitHub
parent f2b50e6d72
commit ec97a280ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 15 deletions

View File

@ -43,7 +43,7 @@ if (!class_exists('WC_Retailcrm_Customers')) :
* @param array $retailcrm_settings * @param array $retailcrm_settings
* @param WC_Retailcrm_Customer_Address $customer_address * @param WC_Retailcrm_Customer_Address $customer_address
*/ */
public function __construct($retailcrm = false, $retailcrm_settings, $customer_address) public function __construct($retailcrm, $retailcrm_settings, $customer_address)
{ {
$this->retailcrm = $retailcrm; $this->retailcrm = $retailcrm;
$this->retailcrm_settings = $retailcrm_settings; $this->retailcrm_settings = $retailcrm_settings;
@ -73,7 +73,7 @@ if (!class_exists('WC_Retailcrm_Customers')) :
*/ */
public function isCorporateEnabled() public function isCorporateEnabled()
{ {
if (!$this->retailcrm) { if (!$this->retailcrm instanceof WC_Retailcrm_Proxy) {
return false; return false;
} }
@ -92,7 +92,7 @@ if (!class_exists('WC_Retailcrm_Customers')) :
*/ */
public function createCustomer($customer, $order = null) public function createCustomer($customer, $order = null)
{ {
if (!$this->retailcrm) { if (!$this->retailcrm instanceof WC_Retailcrm_Proxy) {
return null; return null;
} }
@ -126,7 +126,7 @@ if (!class_exists('WC_Retailcrm_Customers')) :
*/ */
public function updateCustomer($customer_id) public function updateCustomer($customer_id)
{ {
if (!$this->retailcrm) { if (!$this->retailcrm instanceof WC_Retailcrm_Proxy) {
return; return;
} }
@ -151,7 +151,7 @@ if (!class_exists('WC_Retailcrm_Customers')) :
*/ */
public function updateCustomerById($customer_id, $crmCustomerId) public function updateCustomerById($customer_id, $crmCustomerId)
{ {
if (!$this->retailcrm) { if (!$this->retailcrm instanceof WC_Retailcrm_Proxy) {
return; return;
} }
@ -178,7 +178,7 @@ if (!class_exists('WC_Retailcrm_Customers')) :
*/ */
public function createCorporateCustomerForOrder($crmCustomerId, $customer, $order) public function createCorporateCustomerForOrder($crmCustomerId, $customer, $order)
{ {
if (!$this->retailcrm) { if (!$this->retailcrm instanceof WC_Retailcrm_Proxy) {
return null; return null;
} }
@ -277,6 +277,7 @@ if (!class_exists('WC_Retailcrm_Customers')) :
$this->customerCorporateCompany['address'] = array( $this->customerCorporateCompany['address'] = array(
'id' => $response['id'], 'id' => $response['id'],
); );
$this->retailcrm->customersCorporateCompaniesCreate( $this->retailcrm->customersCorporateCompaniesCreate(
$customerId, $customerId,
$this->customerCorporateCompany, $this->customerCorporateCompany,

View File

@ -45,7 +45,7 @@ if ( ! class_exists( 'WC_Retailcrm_Orders' ) ) :
private $payment = array(); private $payment = array();
public function __construct( public function __construct(
$retailcrm = false, $retailcrm,
$retailcrm_settings, $retailcrm_settings,
$order_item, $order_item,
$order_address, $order_address,
@ -72,7 +72,7 @@ if ( ! class_exists( 'WC_Retailcrm_Orders' ) ) :
*/ */
public function orderCreate($order_id) public function orderCreate($order_id)
{ {
if (!$this->retailcrm) { if (!$this->retailcrm instanceof WC_Retailcrm_Proxy) {
return null; return null;
} }
@ -245,7 +245,7 @@ if ( ! class_exists( 'WC_Retailcrm_Orders' ) ) :
*/ */
public function updateOrder($order_id) public function updateOrder($order_id)
{ {
if (!$this->retailcrm) { if (!$this->retailcrm instanceof WC_Retailcrm_Proxy) {
return null; return null;
} }

View File

@ -76,16 +76,16 @@ if (class_exists('WC_Retailcrm_Uploader') === false) {
/** /**
* Uploads archive order in CRM * Uploads archive order in CRM
* *
* @param integer $page Number page uploads. * @param int $page Number page uploads.
* @param array $ids Ids orders upload. * @param array $ids Ids orders upload.
* *
* @return array * @return array|null
* @throws Exception Invalid argument exception. * @throws Exception Invalid argument exception.
*/ */
public function uploadArchiveOrders($page, $ids = array()) public function uploadArchiveOrders($page, $ids = array())
{ {
if (is_object($this->retailcrm) === false) { if (!$this->retailcrm instanceof WC_Retailcrm_Proxy) {
return; return null;
} }
$uploadErrors = array(); $uploadErrors = array();
@ -117,8 +117,8 @@ if (class_exists('WC_Retailcrm_Uploader') === false) {
*/ */
public function uploadArchiveCustomers($page) public function uploadArchiveCustomers($page)
{ {
if (is_object($this->retailcrm) === false) { if (!$this->retailcrm instanceof WC_Retailcrm_Proxy) {
return; return null;
} }
$users = $this->getCmsUsers($page); $users = $this->getCmsUsers($page);