Skip to content

Commit

Permalink
Clean up ConsoleConfig ignoring one phpstan error
Browse files Browse the repository at this point in the history
  • Loading branch information
Chemaclass committed Sep 18, 2022
1 parent bad811c commit 8f94e13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ parameters:

ignoreErrors:
- '#Method Gacela\\.*::.* should return array<.*> but returns array#'
- '#Method Gacela\\.*::.* should return array{.*} but returns array#'
7 changes: 3 additions & 4 deletions src/Console/ConsoleConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public function getDependencyProviderMakerTemplate(): string
}

/**
* @psalm-suppress MixedReturnTypeCoercion
*
* @throws JsonException
*
* @return array{autoload: array{psr-4: array<string,string>}}
Expand All @@ -42,10 +44,7 @@ public function getComposerJsonContentAsArray(): array
throw new LogicException('composer.json file not found but it is required');
}

/** @var array{autoload: array{psr-4: array<string,string>}} $json */
$json = (array)json_decode((string)file_get_contents($filename), true, 512, JSON_THROW_ON_ERROR);

return $json;
return (array)json_decode((string)file_get_contents($filename), true, 512, JSON_THROW_ON_ERROR);
}

private function getCommandTemplateContent(string $filename): string
Expand Down

0 comments on commit 8f94e13

Please sign in to comment.