From 1bc16251df52b74aa63632af032cbbceedebdb7a Mon Sep 17 00:00:00 2001 From: Annegret Seufert Date: Tue, 3 Jul 2018 10:44:25 +0200 Subject: [PATCH] [SHPWR-298] php 5.4 compatibility --- Bootstrapping/Events/PaymentFilterSubscriber.php | 9 +++++++-- Component/Mapper/ModelFactory.php | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Bootstrapping/Events/PaymentFilterSubscriber.php b/Bootstrapping/Events/PaymentFilterSubscriber.php index 69b9b586..2f456bce 100644 --- a/Bootstrapping/Events/PaymentFilterSubscriber.php +++ b/Bootstrapping/Events/PaymentFilterSubscriber.php @@ -207,7 +207,12 @@ private function getRatePayPluginConfigByCountry($shopId, $country) { * @return bool */ private function existsAndNotEmpty($method, $object) { - $check = (method_exists($object, $method) && !empty($object->$method()) && !is_null($object->$method())); - return $check; + if (method_exists($object, $method)) { + $var = $object->$method(); + if (!empty($var) && !is_null($var)) { + return true; + } + } + return false; } } \ No newline at end of file diff --git a/Component/Mapper/ModelFactory.php b/Component/Mapper/ModelFactory.php index 02202961..6139ee51 100755 --- a/Component/Mapper/ModelFactory.php +++ b/Component/Mapper/ModelFactory.php @@ -429,8 +429,13 @@ private function callPaymentRequest() * @return bool */ private function existsAndNotEmpty(&$object, $method) { - $check = (method_exists($object, $method) && !empty($object->$method()) && !is_null($object->$method())); - return $check; + if (method_exists($object, $method)) { + $var = $object->$method(); + if (!empty($var) && !is_null($var)) { + return true; + } + } + return false; } /**