Skip to content

Commit

Permalink
PHP 8.4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
puzzledmonkey committed Sep 29, 2024
1 parent ea3563a commit abbb2a0
Show file tree
Hide file tree
Showing 60 changed files with 148 additions and 148 deletions.
18 changes: 9 additions & 9 deletions build/Burgomaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,21 @@ public function deepCopy($from, $to)
*
* Any LICENSE file is automatically copied.
*
* @param string $sourceDir Source directory to copy from
* @param string $destDir Directory to copy the files to that is relative
* to the the stage base directory.
* @param array $extensions File extensions to copy from the $sourceDir.
* Defaults to "php" files only (e.g., ['php']).
* @param Iterator|null $files Files to copy from the source directory, each
* yielded out as an SplFileInfo object.
* Defaults to a recursive iterator of $sourceDir
* @param string $sourceDir Source directory to copy from
* @param string $destDir Directory to copy the files to that is relative
* to the the stage base directory.
* @param array $extensions File extensions to copy from the $sourceDir.
* Defaults to "php" files only (e.g., ['php']).
* @param Iterator|null $files Files to copy from the source directory, each
* yielded out as an SplFileInfo object.
* Defaults to a recursive iterator of $sourceDir
* @throws \InvalidArgumentException if the source directory is invalid.
*/
function recursiveCopy(
$sourceDir,
$destDir,
$extensions = array('php', 'php.gz'),
Iterator $files = null
Iterator|null $files = null
) {
if (!realpath($sourceDir)) {
throw new \InvalidArgumentException("$sourceDir not found");
Expand Down
4 changes: 2 additions & 2 deletions features/bootstrap/Aws/Test/Integ/SmokeContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,9 @@ public function theResponseShouldContainA($key)
* @Then the error code should be :errorCode
*
* @param string $errorCode
* @param PyStringNode $string
* @param PyStringNode|null $string
*/
public function theErrorCodeShouldBe($errorCode, PyStringNode $string = null)
public function theErrorCodeShouldBe($errorCode, PyStringNode|null $string = null)
{
$this->iExpectTheResponseErrorCodeToBe($errorCode);

Expand Down
8 changes: 4 additions & 4 deletions features/bootstrap/Aws/Test/UsesServiceTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ private function getTestClient($service, array $args = [])
*
* @param AwsClientInterface $client
* @param Result[]|array[] $results
* @param callable $onFulfilled Callback to invoke when the return value is fulfilled.
* @param callable $onRejected Callback to invoke when the return value is rejected.
* @param callable|null $onFulfilled Callback to invoke when the return value is fulfilled.
* @param callable|null $onRejected Callback to invoke when the return value is rejected.
*
* @return AwsClientInterface
*/
private function addMockResults(
AwsClientInterface $client,
array $results,
callable $onFulfilled = null,
callable $onRejected = null
callable|null $onFulfilled = null,
callable|null $onRejected = null
) {
foreach ($results as &$res) {
if (is_array($res)) {
Expand Down
6 changes: 3 additions & 3 deletions src/Api/ApiProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ public function __invoke($type, $service, $version)
}

/**
* @param string $modelsDir Directory containing service models.
* @param array $manifest The API version manifest data.
* @param string $modelsDir Directory containing service models.
* @param array|null $manifest The API version manifest data.
*/
private function __construct($modelsDir, array $manifest = null)
private function __construct($modelsDir, array|null $manifest = null)
{
$this->manifest = $manifest;
$this->modelsDir = rtrim($modelsDir, '/');
Expand Down
4 changes: 2 additions & 2 deletions src/Api/ErrorParser/AbstractErrorParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ abstract class AbstractErrorParser
/**
* @param Service $api
*/
public function __construct(Service $api = null)
public function __construct(Service|null $api = null)
{
$this->api = $api;
}
Expand All @@ -47,7 +47,7 @@ protected function extractPayload(
protected function populateShape(
array &$data,
ResponseInterface $response,
CommandInterface $command = null
CommandInterface|null $command = null
) {
$data['body'] = [];

Expand Down
4 changes: 2 additions & 2 deletions src/Api/ErrorParser/JsonRpcErrorParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ class JsonRpcErrorParser extends AbstractErrorParser

private $parser;

public function __construct(Service $api = null, JsonParser $parser = null)
public function __construct(Service|null $api = null, JsonParser|null $parser = null)
{
parent::__construct($api);
$this->parser = $parser ?: new JsonParser();
}

public function __invoke(
ResponseInterface $response,
CommandInterface $command = null
CommandInterface|null $command = null
) {
$data = $this->genericHandler($response);

Expand Down
4 changes: 2 additions & 2 deletions src/Api/ErrorParser/RestJsonErrorParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ class RestJsonErrorParser extends AbstractErrorParser

private $parser;

public function __construct(Service $api = null, JsonParser $parser = null)
public function __construct(Service|null $api = null, JsonParser|null $parser = null)
{
parent::__construct($api);
$this->parser = $parser ?: new JsonParser();
}

public function __invoke(
ResponseInterface $response,
CommandInterface $command = null
CommandInterface|null $command = null
) {
$data = $this->genericHandler($response);

Expand Down
4 changes: 2 additions & 2 deletions src/Api/ErrorParser/XmlErrorParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ class XmlErrorParser extends AbstractErrorParser

protected $parser;

public function __construct(Service $api = null, XmlParser $parser = null)
public function __construct(Service|null $api = null, XmlParser|null $parser = null)
{
parent::__construct($api);
$this->parser = $parser ?: new XmlParser();
}

public function __invoke(
ResponseInterface $response,
CommandInterface $command = null
CommandInterface|null $command = null
) {
$code = (string) $response->getStatusCode();

Expand Down
6 changes: 3 additions & 3 deletions src/Api/Parser/JsonRpcParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class JsonRpcParser extends AbstractParser
use PayloadParserTrait;

/**
* @param Service $api Service description
* @param JsonParser $parser JSON body builder
* @param Service $api Service description
* @param JsonParser|null $parser JSON body builder
*/
public function __construct(Service $api, JsonParser $parser = null)
public function __construct(Service $api, JsonParser|null $parser = null)
{
parent::__construct($api);
$this->parser = $parser ?: new JsonParser();
Expand Down
8 changes: 4 additions & 4 deletions src/Api/Parser/QueryParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ class QueryParser extends AbstractParser
private $honorResultWrapper;

/**
* @param Service $api Service description
* @param XmlParser $xmlParser Optional XML parser
* @param bool $honorResultWrapper Set to false to disable the peeling
* @param Service $api Service description
* @param XmlParser|null $xmlParser Optional XML parser
* @param bool $honorResultWrapper Set to false to disable the peeling
* back of result wrappers from the
* output structure.
*/
public function __construct(
Service $api,
XmlParser $xmlParser = null,
XmlParser|null $xmlParser = null,
$honorResultWrapper = true
) {
parent::__construct($api);
Expand Down
6 changes: 3 additions & 3 deletions src/Api/Parser/RestJsonParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ class RestJsonParser extends AbstractRestParser
use PayloadParserTrait;

/**
* @param Service $api Service description
* @param JsonParser $parser JSON body builder
* @param Service $api Service description
* @param JsonParser|null $parser JSON body builder
*/
public function __construct(Service $api, JsonParser $parser = null)
public function __construct(Service $api, JsonParser|null $parser = null)
{
parent::__construct($api);
$this->parser = $parser ?: new JsonParser();
Expand Down
6 changes: 3 additions & 3 deletions src/Api/Parser/RestXmlParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ class RestXmlParser extends AbstractRestParser
use PayloadParserTrait;

/**
* @param Service $api Service description
* @param XmlParser $parser XML body parser
* @param Service $api Service description
* @param XmlParser|null $parser XML body parser
*/
public function __construct(Service $api, XmlParser $parser = null)
public function __construct(Service $api, XmlParser|null $parser = null)
{
parent::__construct($api);
$this->parser = $parser ?: new XmlParser();
Expand Down
8 changes: 4 additions & 4 deletions src/Api/Serializer/JsonRpcSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ class JsonRpcSerializer
private $contentType;

/**
* @param Service $api Service description
* @param string $endpoint Endpoint to connect to
* @param JsonBody $jsonFormatter Optional JSON formatter to use
* @param Service $api Service description
* @param string $endpoint Endpoint to connect to
* @param JsonBody|null $jsonFormatter Optional JSON formatter to use
*/
public function __construct(
Service $api,
$endpoint,
JsonBody $jsonFormatter = null
JsonBody|null $jsonFormatter = null
) {
$this->endpoint = $endpoint;
$this->api = $api;
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Serializer/QuerySerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class QuerySerializer
public function __construct(
Service $api,
$endpoint,
callable $paramBuilder = null
callable|null $paramBuilder = null
) {
$this->api = $api;
$this->endpoint = $endpoint;
Expand Down
8 changes: 4 additions & 4 deletions src/Api/Serializer/RestJsonSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ class RestJsonSerializer extends RestSerializer
private $contentType;

/**
* @param Service $api Service API description
* @param string $endpoint Endpoint to connect to
* @param JsonBody $jsonFormatter Optional JSON formatter to use
* @param Service $api Service API description
* @param string $endpoint Endpoint to connect to
* @param JsonBody|null $jsonFormatter Optional JSON formatter to use
*/
public function __construct(
Service $api,
$endpoint,
JsonBody $jsonFormatter = null
JsonBody|null $jsonFormatter = null
) {
parent::__construct($api, $endpoint);
$this->contentType = JsonBody::getContentType($api);
Expand Down
8 changes: 4 additions & 4 deletions src/Api/Serializer/RestXmlSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ class RestXmlSerializer extends RestSerializer
private $xmlBody;

/**
* @param Service $api Service API description
* @param string $endpoint Endpoint to connect to
* @param XmlBody $xmlBody Optional XML formatter to use
* @param Service $api Service API description
* @param string $endpoint Endpoint to connect to
* @param XmlBody|null $xmlBody Optional XML formatter to use
*/
public function __construct(
Service $api,
$endpoint,
XmlBody $xmlBody = null
XmlBody|null $xmlBody = null
) {
parent::__construct($api, $endpoint);
$this->xmlBody = $xmlBody ?: new XmlBody($api);
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public static function createSerializer(Service $api, $endpoint)
* @return callable
* @throws \UnexpectedValueException
*/
public static function createErrorParser($protocol, Service $api = null)
public static function createErrorParser($protocol, Service|null $api = null)
{
static $mapping = [
'json' => ErrorParser\JsonRpcErrorParser::class,
Expand Down
10 changes: 5 additions & 5 deletions src/Api/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ class Validator
];

/**
* @param array $constraints Associative array of constraints to enforce.
* Accepts the following keys: "required", "min",
* "max", and "pattern". If a key is not
* provided, the constraint will assume false.
* @param array|null $constraints Associative array of constraints to enforce.
* Accepts the following keys: "required", "min",
* "max", and "pattern". If a key is not
* provided, the constraint will assume false.
*/
public function __construct(array $constraints = null)
public function __construct(array|null $constraints = null)
{
static $assumedFalseValues = [
'required' => false,
Expand Down
2 changes: 1 addition & 1 deletion src/Auth/AuthSchemeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class AuthSchemeResolver implements AuthSchemeResolverInterface

public function __construct(
callable $credentialProvider,
callable $tokenProvider = null,
callable|null $tokenProvider = null,
array $authSchemeMap = []
){
$this->credentialProvider = $credentialProvider;
Expand Down
2 changes: 1 addition & 1 deletion src/CloudSearchDomain/CloudSearchDomainClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private function searchByPost()
return static function (callable $handler) {
return function (
CommandInterface $c,
RequestInterface $r = null
RequestInterface|null $r = null
) use ($handler) {
if ($c->getName() !== 'Search') {
return $handler($c, $r);
Expand Down
8 changes: 4 additions & 4 deletions src/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ class Command implements CommandInterface
*
* - @http: (array) Associative array of transfer options.
*
* @param string $name Name of the command
* @param array $args Arguments to pass to the command
* @param HandlerList $list Handler list
* @param string $name Name of the command
* @param array $args Arguments to pass to the command
* @param HandlerList|null $list Handler list
*/
public function __construct($name, array $args = [], HandlerList $list = null)
public function __construct($name, array $args = [], HandlerList|null $list = null)
{
$this->name = $name;
$this->data = $args;
Expand Down
2 changes: 1 addition & 1 deletion src/EndpointV2/EndpointV2Middleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function __construct(
EndpointProviderV2 $endpointProvider,
Service $api,
array $args,
callable $credentialProvider = null
callable|null $credentialProvider = null
)
{
$this->nextHandler = $nextHandler;
Expand Down
4 changes: 2 additions & 2 deletions src/Exception/AwsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ class AwsException extends \RuntimeException implements
* @param string $message Exception message
* @param CommandInterface $command
* @param array $context Exception context
* @param \Exception $previous Previous exception (if any)
* @param \Exception|null $previous Previous exception (if any)
*/
public function __construct(
$message,
CommandInterface $command,
array $context = [],
\Exception $previous = null
\Exception|null $previous = null
) {
$this->data = isset($context['body']) ? $context['body'] : [];
$this->command = $command;
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/CouldNotCreateChecksumException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class CouldNotCreateChecksumException extends \RuntimeException implements
{
use HasMonitoringEventsTrait;

public function __construct($algorithm, \Exception $previous = null)
public function __construct($algorithm, \Exception|null $previous = null)
{
$prefix = $algorithm === 'md5' ? "An" : "A";
parent::__construct("{$prefix} {$algorithm} checksum could not be "
Expand Down
4 changes: 2 additions & 2 deletions src/Glacier/GlacierClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private function getChecksumsMiddleware()
return function (callable $handler) {
return function (
CommandInterface $command,
RequestInterface $request = null
RequestInterface|null $request = null
) use ($handler) {
// Accept "ContentSHA256" with a lowercase "c" to match other Glacier params.
if (!$command['ContentSHA256'] && $command['contentSHA256']) {
Expand Down Expand Up @@ -195,7 +195,7 @@ private function getApiVersionMiddleware()
return function (callable $handler) {
return function (
CommandInterface $command,
RequestInterface $request = null
RequestInterface|null $request = null
) use ($handler) {
return $handler($command, $request->withHeader(
'x-amz-glacier-version',
Expand Down
2 changes: 1 addition & 1 deletion src/Handler/GuzzleV5/GuzzleHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class GuzzleHandler
/**
* @param ClientInterface $client
*/
public function __construct(ClientInterface $client = null)
public function __construct(ClientInterface|null $client = null)
{
$this->client = $client ?: new Client();
}
Expand Down
Loading

0 comments on commit abbb2a0

Please sign in to comment.