Skip to content

Commit 5b5118b

Browse files
committed
updated array shape
Signed-off-by: Jurj-Bogdan <jurj@dotkernel.com>
1 parent 4559240 commit 5b5118b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

psalm-baseline.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,6 @@
358358
</MixedMethodCall>
359359
</file>
360360
<file src="src/Integration/IntegrationConnectionTrait.php">
361-
<InvalidArrayOffset>
362-
<code><![CDATA[$githubResult['errors']]]></code>
363-
</InvalidArrayOffset>
364361
<MixedAssignment>
365362
<code><![CDATA[$this->ghToken]]></code>
366363
</MixedAssignment>

src/Integration/IntegrationConnectionTrait.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,17 @@ private function getPackageImage(string $package): string
8383
$rawResult = curl_exec($this->githubCurl);
8484
assert(is_string($rawResult));
8585

86-
/** @var array{data: array{repository: array{owner: array{avatarUrl: string}}}}|null $githubResult */
86+
/**
87+
* @var array{data: array{repository: array{owner: array{avatarUrl: string}}}}|array{errors: array{mixed}}|null
88+
* $githubResult
89+
*/
8790
$githubResult = json_decode($rawResult, true, 512, JSON_THROW_ON_ERROR);
8891
$image = '';
8992

9093
if ($githubResult === null || isset($githubResult['errors'])) {
9194
return $image;
9295
}
96+
assert(isset($githubResult['data']['repository']['owner']['avatarUrl']));
9397

9498
return $this->cachePackageOwnerAvatar(
9599
$githubResult['data']['repository']['owner']['avatarUrl'],

0 commit comments

Comments
 (0)