Skip to content

Commit 594e5a2

Browse files
authored
Upgrade to PHP-CS-Fixer 3.17 (#1440)
Also add a rule to trim blank line inside `{}`, `[]` and `()`
1 parent e7dda89 commit 594e5a2

File tree

11 files changed

+12
-15
lines changed

11 files changed

+12
-15
lines changed

src/AwsError/ChainAwsErrorFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ChainAwsErrorFactory implements AwsErrorFactoryInterface
1616
/**
1717
* @param AwsErrorFactoryInterface[]|null $factories
1818
*/
19-
public function __construct(array $factories = null)
19+
public function __construct(?array $factories = null)
2020
{
2121
$this->factories = $factories ?? [
2222
new JsonRestAwsErrorFactory(),

src/Credentials/CacheProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
final class CacheProvider implements CredentialProvider, ResetInterface
1818
{
1919
/**
20-
* @var (null|Credentials)[]
20+
* @var (Credentials|null)[]
2121
*/
2222
private $cache = [];
2323

src/Credentials/ConfigurationProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function getCredentials(Configuration $configuration): ?Credentials
5757
return $credentials;
5858
}
5959

60-
private function getCredentialsFromRole(Credentials $credentials, string $region, string $roleArn, string $roleSessionName = null): ?Credentials
60+
private function getCredentialsFromRole(Credentials $credentials, string $region, string $roleArn, ?string $roleSessionName = null): ?Credentials
6161
{
6262
$roleSessionName = $roleSessionName ?? uniqid('async-aws-', true);
6363
$stsClient = new StsClient(['region' => $region], $credentials, $this->httpClient);

src/Exception/Http/HttpExceptionTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ trait HttpExceptionTrait
2424
*/
2525
private $awsError;
2626

27-
public function __construct(ResponseInterface $response, AwsError $awsError = null)
27+
public function __construct(ResponseInterface $response, ?AwsError $awsError = null)
2828
{
2929
$this->response = $response;
3030
/** @var int $code */

src/HttpClient/AwsHttpClientFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class AwsHttpClientFactory
1414
{
15-
public static function createRetryableClient(HttpClientInterface $httpClient = null, LoggerInterface $logger = null): HttpClientInterface
15+
public static function createRetryableClient(?HttpClientInterface $httpClient = null, ?LoggerInterface $logger = null): HttpClientInterface
1616
{
1717
if (null === $httpClient) {
1818
$httpClient = HttpClient::create();

src/HttpClient/AwsRetryStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class AwsRetryStrategy extends GenericRetryStrategy
1919
private $awsErrorFactory;
2020

2121
// Override Symfony default options for a better integration of AWS servers.
22-
public function __construct(array $statusCodes = self::DEFAULT_RETRY_STATUS_CODES, int $delayMs = 1000, float $multiplier = 2.0, int $maxDelayMs = 0, float $jitter = 0.1, AwsErrorFactoryInterface $awsErrorFactory = null)
22+
public function __construct(array $statusCodes = self::DEFAULT_RETRY_STATUS_CODES, int $delayMs = 1000, float $multiplier = 2.0, int $maxDelayMs = 0, float $jitter = 0.1, ?AwsErrorFactoryInterface $awsErrorFactory = null)
2323
{
2424
parent::__construct($statusCodes, $delayMs, $multiplier, $maxDelayMs, $jitter);
2525
$this->awsErrorFactory = $awsErrorFactory ?? new ChainAwsErrorFactory();

src/Response.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class Response
100100
*/
101101
private $exceptionMapping;
102102

103-
public function __construct(ResponseInterface $response, HttpClientInterface $httpClient, LoggerInterface $logger, AwsErrorFactoryInterface $awsErrorFactory = null, EndpointCache $endpointCache = null, Request $request = null, bool $debug = false, array $exceptionMapping = [])
103+
public function __construct(ResponseInterface $response, HttpClientInterface $httpClient, LoggerInterface $logger, ?AwsErrorFactoryInterface $awsErrorFactory = null, ?EndpointCache $endpointCache = null, ?Request $request = null, bool $debug = false, array $exceptionMapping = [])
104104
{
105105
$this->httpResponse = $response;
106106
$this->httpClient = $httpClient;
@@ -186,7 +186,7 @@ public function resolve(?float $timeout = null): bool
186186
* @throws NetworkException
187187
* @throws HttpException
188188
*/
189-
final public static function wait(iterable $responses, float $timeout = null, bool $downloadBody = false): iterable
189+
final public static function wait(iterable $responses, ?float $timeout = null, bool $downloadBody = false): iterable
190190
{
191191
/** @var self[] $responseMap */
192192
$responseMap = [];

src/Result.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Result
3434
*/
3535
private $prefetchResults = [];
3636

37-
public function __construct(Response $response, AbstractApi $awsClient = null, $request = null)
37+
public function __construct(Response $response, ?AbstractApi $awsClient = null, $request = null)
3838
{
3939
$this->response = $response;
4040
$this->awsClient = $awsClient;
@@ -78,7 +78,7 @@ final public function resolve(?float $timeout = null): bool
7878
* @throws NetworkException
7979
* @throws HttpException
8080
*/
81-
final public static function wait(iterable $results, float $timeout = null, bool $downloadBody = false): iterable
81+
final public static function wait(iterable $results, ?float $timeout = null, bool $downloadBody = false): iterable
8282
{
8383
$resultMap = [];
8484
$responses = [];

src/Waiter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ final public function cancel(): void
171171
*
172172
* @return bool true if a final state was reached
173173
*/
174-
final public function wait(float $timeout = null, float $delay = null): bool
174+
final public function wait(?float $timeout = null, ?float $delay = null): bool
175175
{
176176
if (null !== $this->finalState) {
177177
return true;

tests/Unit/AbstractApiTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function getEndpoint(string $uri, array $query, ?string $region): string
6666
return parent::getEndpoint($uri, $query, $region);
6767
}
6868

69-
public function getResponseExposed(Request $request, RequestContext $context = null): Response
69+
public function getResponseExposed(Request $request, ?RequestContext $context = null): Response
7070
{
7171
return parent::getResponse($request, $context);
7272
}

0 commit comments

Comments
 (0)