File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments