Skip to content

Commit 389d611

Browse files
authored
Fix CI (#362)
* Suppress Psalm errors * Fix SignerV4Test namespace
1 parent 44f2717 commit 389d611

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

src/Credentials/InstanceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ private function toArray(ResponseInterface $response): array
100100
try {
101101
$content = json_decode($content, true, 512, \JSON_BIGINT_AS_STRING | (\PHP_VERSION_ID >= 70300 ? \JSON_THROW_ON_ERROR : 0));
102102
} catch (\JsonException $e) {
103-
/** @psalm-suppress InvalidArgument */
103+
/** @psalm-suppress all */
104104
throw new JsonException(sprintf('%s for "%s".', $e->getMessage(), $response->getInfo('url')), $e->getCode());
105105
}
106106

src/Exception/Http/HttpExceptionTrait.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ trait HttpExceptionTrait
4141
public function __construct(ResponseInterface $response)
4242
{
4343
$this->response = $response;
44+
/** @var int $code */
4445
$code = $response->getInfo('http_code');
46+
/** @var string $url */
4547
$url = $response->getInfo('url');
4648
$content = $response->getContent(false);
4749
$message = sprintf('HTTP %d returned for "%s".', $code, $url);

src/Signer/SignerV4.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ private function sanitizeHostForHeader(Request $request): void
157157
throw new InvalidArgument(sprintf('The endpoint "%s" is invalid.', $request->getEndpoint()));
158158
}
159159

160+
if (!isset($parsedUrl['host'])) {
161+
return;
162+
}
163+
160164
$host = $parsedUrl['host'];
161165
if (isset($parsedUrl['port'])) {
162166
$host .= ':' . $parsedUrl['port'];

tests/Unit/Signer/SignerV4Test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace AsyncAws\Core\Tests\Unit;
5+
namespace AsyncAws\Core\Tests\Unit\Signer;
66

77
use AsyncAws\Core\Credentials\Credentials;
88
use AsyncAws\Core\Request;

0 commit comments

Comments
 (0)