1
0
mirror of synced 2025-01-29 22:31:42 +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 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_settings = $retailcrm_settings;
@ -73,7 +73,7 @@ if (!class_exists('WC_Retailcrm_Customers')) :
*/
public function isCorporateEnabled()
{
if (!$this->retailcrm) {
if (!$this->retailcrm instanceof WC_Retailcrm_Proxy) {
return false;
}
@ -92,7 +92,7 @@ if (!class_exists('WC_Retailcrm_Customers')) :
*/
public function createCustomer($customer, $order = null)
{
if (!$this->retailcrm) {
if (!$this->retailcrm instanceof WC_Retailcrm_Proxy) {
return null;
}
@ -126,7 +126,7 @@ if (!class_exists('WC_Retailcrm_Customers')) :
*/
public function updateCustomer($customer_id)
{
if (!$this->retailcrm) {
if (!$this->retailcrm instanceof WC_Retailcrm_Proxy) {
return;
}
@ -151,7 +151,7 @@ if (!class_exists('WC_Retailcrm_Customers')) :
*/
public function updateCustomerById($customer_id, $crmCustomerId)
{
if (!$this->retailcrm) {
if (!$this->retailcrm instanceof WC_Retailcrm_Proxy) {
return;
}
@ -178,7 +178,7 @@ if (!class_exists('WC_Retailcrm_Customers')) :
*/
public function createCorporateCustomerForOrder($crmCustomerId, $customer, $order)
{
if (!$this->retailcrm) {
if (!$this->retailcrm instanceof WC_Retailcrm_Proxy) {
return null;
}
@ -277,6 +277,7 @@ if (!class_exists('WC_Retailcrm_Customers')) :
$this->customerCorporateCompany['address'] = array(
'id' => $response['id'],
);
$this->retailcrm->customersCorporateCompaniesCreate(
$customerId,
$this->customerCorporateCompany,

View File

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

View File

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