Add missing type definitions for psalm

Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
Simon L. 2026-02-03 17:53:39 +01:00
parent 9c0334d3f0
commit 87e005be4b
9 changed files with 97 additions and 21 deletions

View file

@ -18,6 +18,7 @@ readonly class GitHubContainerRegistryManager
{
$cacheKey = 'ghcr-manifest-' . $name . $tag;
/** @psalm-var mixed $cachedVersion */
$cachedVersion = apcu_fetch($cacheKey);
if ($cachedVersion !== false && is_string($cachedVersion)) {
return $cachedVersion;
@ -31,9 +32,10 @@ readonly class GitHubContainerRegistryManager
'https://ghcr.io/token?scope=repository:' . $name . ':pull'
);
$body = $authTokenRequest->getBody()->getContents();
/** @var array */
$decodedBody = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
if (isset($decodedBody['token'])) {
$authToken = $decodedBody['token'];
$authToken = (string) $decodedBody['token'];
$manifestRequest = $this->guzzleClient->request(
'HEAD',
'https://ghcr.io/v2/' . $name . '/manifests/' . $tag,