Skip to content

Commit bba3a05

Browse files
authored
Merge pull request #104 from mpesari/php-8.5
Add support for PHP 8.5
2 parents 8ad3fbb + 93a99b8 commit bba3a05

File tree

7 files changed

+19
-7
lines changed

7 files changed

+19
-7
lines changed

.github/workflows/run-workflow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
continue-on-error: ${{ matrix.experimental }}
1515
strategy:
1616
matrix:
17-
php-version: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
17+
php-version: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
1818
experimental: [false]
1919
steps:
2020
- uses: actions/checkout@v3

src/Util/CurlClient.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ public function request(string $method, string $uri, array $options)
4848
$header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
4949
$headers = rtrim(substr($response, 0, $header_size));
5050
$body = substr($response, $header_size);
51-
curl_close($curl);
51+
if (PHP_VERSION_ID < 80000) {
52+
curl_close($curl);
53+
}
5254

5355
if ($statusCode == 400) {
5456
throw new ClientException($body, $statusCode);

tests/Model/AbstractPaymentRequestTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ private function setProtectedProperty(
103103
string $value
104104
): void {
105105
$attribute = new ReflectionProperty($paymentRequest, $propertyName);
106-
$attribute->setAccessible(true);
106+
if (PHP_VERSION_ID < 80100) {
107+
$attribute->setAccessible(true);
108+
}
107109
$attribute->setValue($paymentRequest, $value);
108110
}
109111

tests/Model/Token/CardTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ public function setPrivateProperty($class, $propertyName, $value)
195195
{
196196
$reflector = new \ReflectionClass($class);
197197
$property = $reflector->getProperty($propertyName);
198-
$property->setAccessible(true);
198+
if (PHP_VERSION_ID < 80100) {
199+
$property->setAccessible(true);
200+
}
199201
$property->setValue($class, $value);
200202
}
201203
}

tests/Model/Token/CustomerTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ public function setPrivateProperty($class, $propertyName, $value)
6969
{
7070
$reflector = new \ReflectionClass($class);
7171
$property = $reflector->getProperty($propertyName);
72-
$property->setAccessible(true);
72+
if (PHP_VERSION_ID < 80100) {
73+
$property->setAccessible(true);
74+
}
7375
$property->setValue($class, $value);
7476
}
7577
}

tests/Request/AddCardFormRequestTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ public function setPrivateProperty($class, $propertyName, $value)
135135
{
136136
$reflector = new \ReflectionClass($class);
137137
$property = $reflector->getProperty($propertyName);
138-
$property->setAccessible(true);
138+
if (PHP_VERSION_ID < 80100) {
139+
$property->setAccessible(true);
140+
}
139141
$property->setValue($class, $value);
140142
}
141143
}

tests/Request/GetTokenRequestTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ public function setPrivateProperty($class, $propertyName, $value)
5252
{
5353
$reflector = new \ReflectionClass($class);
5454
$property = $reflector->getProperty($propertyName);
55-
$property->setAccessible(true);
55+
if (PHP_VERSION_ID < 80100) {
56+
$property->setAccessible(true);
57+
}
5658
$property->setValue($class, $value);
5759
}
5860
}

0 commit comments

Comments
 (0)