Skip to content

Commit 11f4a46

Browse files
committed
Bump PHP 8.4
1 parent b943e72 commit 11f4a46

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"symfony/phpunit-bridge": "^6.4 || ^7.0"
3434
},
3535
"require-dev": {
36-
"simplesamlphp/simplesamlphp": "^2"
36+
"simplesamlphp/simplesamlphp": "^2.2"
3737
},
3838
"support": {
3939
"issues": "https://github.com/simplesamlphp/simplesamlphp-test-framework/issues",

lib/BuiltInServer.php

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,32 @@
44

55
namespace SimpleSAML\TestUtils;
66

7+
use InvalidArgumentException;
78
use SimpleSAML\Utils;
89

10+
use function array_shift;
11+
use function curl_close;
12+
use function curl_init;
13+
use function curl_exec;
14+
use function curl_getinfo;
15+
use function curl_setopt_array;
16+
use function dirname;
17+
use function exec;
18+
use function explode;
19+
use function fclose;
20+
use function file_exists;
21+
use function fsockopen;
22+
use function http_build_query;
23+
use function intval;
24+
use function is_null;
25+
use function microtime;
26+
use function mt_rand;
27+
use function rtrim;
28+
use function sleep;
29+
use function sprintf;
30+
use function str_replace;
31+
use function trim;
32+
933
/**
1034
* An extremely simple class to start and stop PHP's built-in server, with the possibility to specify the document
1135
* root and the "router" file to run for every request.
@@ -52,7 +76,7 @@ class BuiltInServer
5276
*
5377
* @see http://php.net/manual/en/features.commandline.webserver.php
5478
*/
55-
public function __construct(string $router = null, string $docroot = null)
79+
public function __construct(?string $router = null, ?string $docroot = null)
5680
{
5781
if (!is_null($router)) {
5882
$this->setRouter($router);
@@ -182,7 +206,7 @@ public function setRouter(string $router): void
182206
{
183207
$file = dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/tests/routers/' . $router . '.php';
184208
if (!file_exists($file)) {
185-
throw new \InvalidArgumentException('Unknown router "' . $router . '".');
209+
throw new InvalidArgumentException('Unknown router "' . $router . '".');
186210
}
187211
$this->router = $file;
188212
}
@@ -208,18 +232,21 @@ public function get(string $query, array $parameters, array $curlopts = []): arr
208232
CURLOPT_HEADER => 1,
209233
]);
210234
curl_setopt_array($ch, $curlopts);
235+
211236
/** @var mixed $resp */
212237
$resp = curl_exec($ch);
213238
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
214239
list($header, $body) = explode("\r\n\r\n", $resp, 2);
215240
$raw_headers = explode("\r\n", $header);
216241
array_shift($raw_headers);
242+
217243
$headers = [];
218244
foreach ($raw_headers as $header) {
219245
list($name, $value) = explode(':', $header, 2);
220246
$headers[trim($name)] = trim($value);
221247
}
222248
curl_close($ch);
249+
223250
return [
224251
'code' => $code,
225252
'headers' => $headers,

lib/SigningTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function tearDown(): void
108108
* @param mixed|null $value
109109
* @return void
110110
*/
111-
protected function clearInstance(Configuration $service, string $className, $value = null): void
111+
protected function clearInstance(Configuration $service, string $className, ?$value = null): void
112112
{
113113
$reflectedClass = new ReflectionClass($className);
114114
$reflectedInstance = $reflectedClass->getProperty('instance');

0 commit comments

Comments
 (0)