From 3dd663e7a640281afcd77f7307fc907a19cb2e64 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Fri, 28 Jul 2017 10:11:47 +0300 Subject: [PATCH] Update CustomFields.php --- lib/RetailCrm/Methods/V5/CustomFields.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/RetailCrm/Methods/V5/CustomFields.php b/lib/RetailCrm/Methods/V5/CustomFields.php index 898878c..ed6c296 100644 --- a/lib/RetailCrm/Methods/V5/CustomFields.php +++ b/lib/RetailCrm/Methods/V5/CustomFields.php @@ -77,7 +77,7 @@ trait CustomFields ); } - if (empty($entity) || $entity != 'customer' || $entity != 'order') { + if (empty($entity) || !in_array($entity, ['customer', 'order'])) { throw new \InvalidArgumentException( 'Parameter `entity` must contain a data & value must be `order` or `customer`' ); @@ -106,7 +106,7 @@ trait CustomFields ); } - if (empty($entity) || $entity != 'customer' || $entity != 'order') { + if (empty($entity) || !in_array($entity, ['customer', 'order'])) { throw new \InvalidArgumentException( 'Parameter `entity` must contain a data & value must be `order` or `customer`' ); @@ -135,7 +135,7 @@ trait CustomFields ); } - if (empty($entity) || $entity != 'customer' || $entity != 'order') { + if (empty($entity) || !in_array($entity, ['customer', 'order'])) { throw new \InvalidArgumentException( 'Parameter `entity` must contain a data & value must be `order` or `customer`' );