Skip to content

Commit

Permalink
Bump psalm level from 5 to 4 (lower is stricter)
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Aug 30, 2022
1 parent a51b0f3 commit ba3d9c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 8 additions & 10 deletions lib/Command/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,16 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$types = $input->getOption('types');
if ($types !== false) {
$types = explode(',', $types);
if ($types !== false) {
if (count($types) === 1 && reset($types) === 'none') {
$selectedMigrators = [];
} else {
foreach ($types as $id) {
if (!in_array($id, array_map(fn (IMigrator $migrator) => $migrator->getId(), $migrators), true)) {
$io->error("Invalid type: \"$id\"");
return 1;
}
if (count($types) === 1 && reset($types) === 'none') {
$selectedMigrators = [];
} else {
foreach ($types as $id) {
if (!in_array($id, array_map(fn (IMigrator $migrator) => $migrator->getId(), $migrators), true)) {
$io->error("Invalid type: \"$id\"");
return 1;
}
$selectedMigrators = $types;
}
$selectedMigrators = $types;
}
}

Expand Down
2 changes: 1 addition & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<psalm
errorLevel="5"
errorLevel="4"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
Expand Down

0 comments on commit ba3d9c8

Please sign in to comment.