Skip to content

Commit 6687cba

Browse files
committed
Fix deprecation for null array offset on PHP 8.5
1 parent 96b7fe3 commit 6687cba

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Core/src/AbstractApi.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,8 @@ private function getDiscoveredEndpoint(string $uri, array $query, ?string $regio
324324
*/
325325
private function getSigner(?string $region): Signer
326326
{
327-
/** @var string $region */
328327
$region = $region ?? ($this->configuration->isDefault('region') ? null : $this->configuration->get('region'));
329-
if (!isset($this->signers[$region])) {
328+
if (!isset($this->signers[$region ?? ''])) {
330329
$factories = $this->getSignerFactories();
331330
$factory = null;
332331
if ($this->configuration->isDefault('endpoint') || $this->configuration->isDefault('region')) {
@@ -349,10 +348,9 @@ private function getSigner(?string $region): Signer
349348
throw new InvalidArgument(\sprintf('None of the signatures "%s" is implemented.', implode(', ', $metadata['signVersions'])));
350349
}
351350

352-
$this->signers[$region] = $factory($metadata['signService'], $metadata['signRegion']);
351+
$this->signers[$region ?? ''] = $factory($metadata['signService'], $metadata['signRegion']);
353352
}
354353

355-
/** @psalm-suppress PossiblyNullArrayOffset */
356-
return $this->signers[$region];
354+
return $this->signers[$region ?? ''];
357355
}
358356
}

0 commit comments

Comments
 (0)