From d364b89ad0ac8349fc6decbdee5731e321383795 Mon Sep 17 00:00:00 2001 From: Phillip Davis Date: Fri, 4 Sep 2026 12:35:11 +0930 Subject: [PATCH] chore: apply rector IfToNullCoalescingAssignRector rule And require ar least rector 2.6 Signed-off-by: Phillip Davis --- composer.json | 2 +- lib/Auth/AWS.php | 4 +--- lib/Client.php | 4 +--- tests/HTTP/SapiTest.php | 4 +--- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 8c7b590..0dd104a 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "phpstan/phpstan-strict-rules": "^2.0", "phpstan/extension-installer": "^1.4", "phpunit/phpunit" : "^11.5", - "rector/rector": "^2.5" + "rector/rector": "^2.6" }, "suggest" : { "ext-curl" : " to make http requests with the Client class" diff --git a/lib/Auth/AWS.php b/lib/Auth/AWS.php index c555e42..10c2749 100644 --- a/lib/Auth/AWS.php +++ b/lib/Auth/AWS.php @@ -97,9 +97,7 @@ public function validate(string $secretKey): bool $requestDate = $this->request->getHeader('x-amz-date'); - if (null === $requestDate) { - $requestDate = $this->request->getHeader('Date'); - } + $requestDate ??= $this->request->getHeader('Date'); if (!$this->validateRFC2616Date((string) $requestDate)) { return false; diff --git a/lib/Client.php b/lib/Client.php index ef54d0e..943fcc8 100644 --- a/lib/Client.php +++ b/lib/Client.php @@ -584,9 +584,7 @@ protected function parseCurlResult(string $response, $curlHandle): array */ protected function sendAsyncInternal(RequestInterface $request, callable $success, callable $error, int $retryCount = 0): void { - if (null === $this->curlMultiHandle) { - $this->curlMultiHandle = curl_multi_init(); - } + $this->curlMultiHandle ??= curl_multi_init(); $curl = curl_init(); curl_setopt_array( $curl, diff --git a/tests/HTTP/SapiTest.php b/tests/HTTP/SapiTest.php index 9eb2008..444832b 100644 --- a/tests/HTTP/SapiTest.php +++ b/tests/HTTP/SapiTest.php @@ -220,9 +220,7 @@ public function testSendContentRangeStream( $ignoreAtStartLength = strlen($ignoreAtStart); $ignoreAtEndLength = strlen($ignoreAtEnd); $body = fopen('php://memory', 'w'); - if (null === $contentLength) { - $contentLength = strlen($partial); - } + $contentLength ??= strlen($partial); fwrite($body, $ignoreAtStart); fwrite($body, $partial); if ($ignoreAtEndLength > 0) {