From 3954bb18eeef57d6b1a4ac795427dafaeeae6bbd Mon Sep 17 00:00:00 2001 From: Steve Taylor Date: Fri, 25 Oct 2019 13:50:16 +1000 Subject: [PATCH] Fix PHP 7.4 bug in PPXmlMessage * ErrorException: Cannot use "parent" when current class scope has no parent vendor/paypal/sdk-core-php/lib/PayPal/Core/PPXmlMessage.php:124 As class has no parent, changed to self instead. * Update travis config with new php versions --- .travis.yml | 9 +++++++-- lib/PayPal/Core/PPXmlFaultMessage.php | 2 +- lib/PayPal/Core/PPXmlMessage.php | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2cef587..f38ffcf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,13 +4,18 @@ matrix: include: - php: 5.3 dist: precise + - php: 5.4 + dist: trusty + - php: 5.5 + dist: trusty php: - - 5.4 - - 5.5 - 5.6 - 7.0 - 7.1 + - 7.2 + - 7.3 + - 7.4snapshot install: - composer install diff --git a/lib/PayPal/Core/PPXmlFaultMessage.php b/lib/PayPal/Core/PPXmlFaultMessage.php index fd1a056..2391f5b 100644 --- a/lib/PayPal/Core/PPXmlFaultMessage.php +++ b/lib/PayPal/Core/PPXmlFaultMessage.php @@ -31,7 +31,7 @@ public function init(array $data = array()) } if (($first = reset($map)) && !is_array($first) && !is_numeric(key($map))) { - parent::init($map, false); + self::init($map); return; } diff --git a/lib/PayPal/Core/PPXmlMessage.php b/lib/PayPal/Core/PPXmlMessage.php index 2c4c355..92b4cf7 100644 --- a/lib/PayPal/Core/PPXmlMessage.php +++ b/lib/PayPal/Core/PPXmlMessage.php @@ -121,7 +121,7 @@ public function init(array $map = array(), $isRoot = true) } if (($first = reset($map)) && !is_array($first) && !is_numeric(key($map))) { - parent::init($map, false); + self::init($map, false); return; }