Skip to content

Commit 9fb6954

Browse files
committed
feat: Add PHP 8.4 support
Signed-off-by: Joas Schilling <[email protected]>
1 parent e32dcf1 commit 9fb6954

File tree

19 files changed

+46
-46
lines changed

19 files changed

+46
-46
lines changed

.github/workflows/unit_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
php: [ 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3 ]
22+
php: [ 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4 ]
2323
composer:
2424
- name: lowest
2525
arg: "--prefer-lowest --prefer-stable"

src/Common/Auth/AuthHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class AuthHandler
2525
/** @var Token */
2626
private $token;
2727

28-
public function __construct(callable $nextHandler, callable $tokenGenerator, Token $token = null)
28+
public function __construct(callable $nextHandler, callable $tokenGenerator, ?Token $token = null)
2929
{
3030
$this->nextHandler = $nextHandler;
3131
$this->tokenGenerator = $tokenGenerator;

src/Common/Error/Builder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Builder
3535
*/
3636
private $client;
3737

38-
public function __construct(ClientInterface $client = null)
38+
public function __construct(?ClientInterface $client = null)
3939
{
4040
$this->client = $client ?: new Client();
4141
}
@@ -164,7 +164,7 @@ private function getStatusCodeMessage(int $statusCode): string
164164
* @param mixed $userValue The incorrect value the user actually provided
165165
* @param string|null $furtherLink a link to further information if necessary (optional)
166166
*/
167-
public function userInputError(string $expectedType, $userValue, string $furtherLink = null): UserInputError
167+
public function userInputError(string $expectedType, $userValue, ?string $furtherLink = null): UserInputError
168168
{
169169
$message = $this->header('User Input Error');
170170

src/Common/HydratorStrategyTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function hydrate(array $data, array $aliases = [])
2525
}
2626
}
2727

28-
public function set(string $key, $property, array $data, callable $fn = null)
28+
public function set(string $key, $property, array $data, ?callable $fn = null)
2929
{
3030
if (isset($data[$key]) && property_exists($this, $property)) {
3131
$value = $fn ? call_user_func($fn, $data[$key]) : $data[$key];

src/Common/JsonSchema/Schema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Schema
1414
/** @var Validator */
1515
private $validator;
1616

17-
public function __construct($body, Validator $validator = null)
17+
public function __construct($body, ?Validator $validator = null)
1818
{
1919
$this->body = (object) $body;
2020
$this->validator = $validator ?: new Validator();

src/Common/Resource/Alias.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Alias
2626
* @param string|null $className A class name for the property value
2727
* @param bool $list Whether value of the property should be treated as a list or not
2828
*/
29-
public function __construct(string $propertyName, string $className = null, bool $list = false)
29+
public function __construct(string $propertyName, ?string $className = null, bool $list = false)
3030
{
3131
$this->isList = $list;
3232
$this->propertyName = $propertyName;

src/Common/Resource/Listable.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ interface Listable
1818
* of the marker will depend on the last element returned in the previous response. If a limit is
1919
* provided, the loop will continue up until that point.
2020
*
21-
* @param array $def The operation definition
22-
* @param array $userVals The user values
23-
* @param callable $mapFn an optional callback that will be executed on every resource iteration
21+
* @param array $def The operation definition
22+
* @param array $userVals The user values
23+
* @param callable|null $mapFn an optional callback that will be executed on every resource iteration
2424
*
2525
* @returns \Generator<mixed, static>
2626
*/
27-
public function enumerate(array $def, array $userVals = [], callable $mapFn = null);
27+
public function enumerate(array $def, array $userVals = [], ?callable $mapFn = null);
2828
}

src/Common/Resource/OperatorResource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private function getResourcesKey(): string
6969
*
7070
* @returns \Generator<mixed, static>
7171
*/
72-
public function enumerate(array $def, array $userVals = [], callable $mapFn = null): \Generator
72+
public function enumerate(array $def, array $userVals = [], ?callable $mapFn = null): \Generator
7373
{
7474
$operation = $this->getOperation($def);
7575

@@ -105,7 +105,7 @@ public function enumerate(array $def, array $userVals = [], callable $mapFn = nu
105105
*
106106
* @return array<self>
107107
*/
108-
public function extractMultipleInstances(ResponseInterface $response, string $key = null): array
108+
public function extractMultipleInstances(ResponseInterface $response, ?string $key = null): array
109109
{
110110
$key = $key ?: $this->getResourcesKey();
111111
$resourcesData = Utils::jsonDecode($response)[$key];

src/Common/Service/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private function stockAuthHandler(array &$options): void
109109
}
110110
}
111111

112-
private function httpClient(string $baseUrl, HandlerStack $stack, string $serviceType = null, string $microVersion = null): ClientInterface
112+
private function httpClient(string $baseUrl, HandlerStack $stack, ?string $serviceType = null, ?string $microVersion = null): ClientInterface
113113
{
114114
$clientOptions = [
115115
'base_uri' => Utils::normalizeUrl($baseUrl),

src/Common/Transport/HandlerStack.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class HandlerStack
1010
/**
1111
* @deprecated use \OpenStack\Common\Transport\HandlerStackFactory::createWithOptions instead
1212
*/
13-
public static function create(callable $handler = null): \GuzzleHttp\HandlerStack
13+
public static function create(?callable $handler = null): \GuzzleHttp\HandlerStack
1414
{
1515
return HandlerStackFactory::create($handler);
1616
}

0 commit comments

Comments
 (0)