Skip to content

Commit c564a1b

Browse files
author
Maxim Usenko
committed
Add support for ^php8
1 parent 21d5159 commit c564a1b

File tree

7 files changed

+8
-17
lines changed

7 files changed

+8
-17
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313
],
1414
"require": {
15-
"php": ">=5.3.0",
15+
"php": "^7.4||^8.0",
1616
"ext-curl": "*"
1717
},
1818
"require-dev": {

lib/PayPal/Common/PPReflectionUtil.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static function getPropertyClass($class, $propertyName)
4747
public static function propertyAnnotations($class, $propertyName)
4848
{
4949
$class = is_object($class) ? get_class($class) : $class;
50-
if (!class_exists('ReflectionProperty')) {
50+
if (!class_exists(\ReflectionProperty::class)) {
5151
throw new \RuntimeException("Property type of " . $class . "::{$propertyName} cannot be resolved");
5252
}
5353

lib/PayPal/Core/PPCredentialManager.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public static function getInstance($config)
4747
*/
4848
private function initCredential($config)
4949
{
50+
$searchKey = null;
5051
$suffix = 1;
5152
$prefix = "acct";
5253
if (array_key_exists($prefix, $config)) {

lib/PayPal/Core/PPHttpConfig.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct($url = null, $method = self::HTTP_POST, $configs = a
4848
{
4949
$this->url = $url;
5050
$this->method = $method;
51-
$this->curlOptions = $this->getHttpConstantsFromConfigs($configs, 'http.') + self::$DEFAULT_CURL_OPTS;
51+
$this->curlOptions = $this->getHttpConstantsFromConfigs('http.', $configs) + self::$DEFAULT_CURL_OPTS;
5252
// Update the Cipher List based on OpenSSL or NSS settings
5353
$curl = curl_version();
5454
$sslVersion = isset($curl['ssl_version']) ? $curl['ssl_version'] : '';
@@ -217,7 +217,7 @@ public function setUserAgent($userAgentString)
217217
*
218218
* @return array
219219
*/
220-
public function getHttpConstantsFromConfigs($configs = array(), $prefix)
220+
public function getHttpConstantsFromConfigs($prefix, $configs = array())
221221
{
222222
$arr = array();
223223
if ($prefix != null && is_array($configs)) {

lib/PayPal/Core/PPUtils.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public static function filterKeyPrefix(array $map, $keyPrefix)
185185
}
186186

187187
/**
188-
* @var array|ReflectionProperty[]
188+
* @var array|\ReflectionProperty[]
189189
*/
190190
private static $propertiesRefl = array();
191191

@@ -200,13 +200,13 @@ public static function filterKeyPrefix(array $map, $keyPrefix)
200200
* @param string $class
201201
* @param string $propertyName
202202
*
203-
* @throws RuntimeException
203+
* @throws \RuntimeException
204204
* @return string
205205
*/
206206
public static function propertyAnnotations($class, $propertyName)
207207
{
208208
$class = is_object($class) ? get_class($class) : $class;
209-
if (!class_exists('ReflectionProperty')) {
209+
if (!class_exists(\ReflectionProperty::class)) {
210210
throw new \RuntimeException("Property type of " . $class . "::{$propertyName} cannot be resolved");
211211
}
212212

lib/PayPal/Core/PPXmlFaultMessage.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ public function init(array $data = array())
3030
return;
3131
}
3232

33-
if (($first = reset($map)) && !is_array($first) && !is_numeric(key($map))) {
34-
parent::init($map, false);
35-
return;
36-
}
37-
3833
$propertiesMap = PPUtils::objectProperties($this);
3934
$arrayCtr = array();
4035
foreach ($map as $element) {

lib/PayPal/Core/PPXmlMessage.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,6 @@ public function init(array $map = array(), $isRoot = true)
120120
return;
121121
}
122122

123-
if (($first = reset($map)) && !is_array($first) && !is_numeric(key($map))) {
124-
parent::init($map, false);
125-
return;
126-
}
127-
128123
$propertiesMap = PPUtils::objectProperties($this);
129124
$arrayCtr = array();
130125
foreach ($map as $element) {

0 commit comments

Comments
 (0)