Skip to content

Commit e8e1358

Browse files
committed
fix: align getArchitectures typing with main
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 2412969 commit e8e1358

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

lib/Service/Install/SignSetupService.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,15 @@ public function setResource(string $resource): self {
7070

7171
public function getArchitectures(): array {
7272
$appInfo = $this->appManager->getAppInfo(Application::APP_ID);
73-
$architectures = $appInfo['dependencies']['architecture'] ?? null;
74-
if (empty($architectures)) {
73+
if (!is_array($appInfo) || !isset($appInfo['dependencies'])) {
7574
throw new \Exception('dependencies>architecture not found at info.xml');
7675
}
77-
if (is_string($architectures)) {
78-
return [$architectures];
79-
}
80-
if (!is_array($architectures)) {
81-
throw new \Exception('dependencies>architecture has invalid format at info.xml');
76+
/** @var list<string> $architectures */
77+
$architectures = $appInfo['dependencies']['architecture'] ?? [];
78+
if ($architectures === []) {
79+
throw new \Exception('dependencies>architecture not found at info.xml');
8280
}
83-
return array_values(array_map(static fn (mixed $architecture): string => (string)$architecture, $architectures));
81+
return $architectures;
8482
}
8583

8684
public function setPrivateKey(PrivateKey $privateKey): void {

0 commit comments

Comments
 (0)