Skip to content

Commit fc1fab0

Browse files
committed
Fix psalm error
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent c619310 commit fc1fab0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/Command/RemoveLegacyTags.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ protected function configure() {
3939
*/
4040
protected function execute(InputInterface $input, OutputInterface $output): int {
4141
try {
42-
$tagNames = \Safe\json_decode(file_get_contents(__DIR__ . '/../../src/things.json'), true);
42+
/** @var list<string> $tagNames */
43+
$tagNames = \json_decode(file_get_contents(__DIR__ . '/../../src/things.json'), true);
44+
if (JSON_ERROR_NONE !== json_last_error()) {
45+
throw new \Exception('JSON error');
46+
}
4347
$tagNames = array_map(fn ($tagName) => strtolower($tagName), $tagNames);
4448
$this->tagManager->removeTags($tagNames);
4549
} catch (\Exception $ex) {

0 commit comments

Comments
 (0)