Skip to content

Commit

Permalink
Merge pull request #9 from ratepay/bug/SHPWR-298_update_fix
Browse files Browse the repository at this point in the history
[SHPWR-298] php 5.4 compatibility
  • Loading branch information
rpWhittington authored Jul 3, 2018
2 parents 6039bb8 + 1bc1625 commit 0d3a482
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions Bootstrapping/Events/PaymentFilterSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
9 changes: 7 additions & 2 deletions Component/Mapper/ModelFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 0d3a482

Please sign in to comment.