Skip to content

Commit

Permalink
fixup! feat: mail filters
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kesselberg <[email protected]>
  • Loading branch information
kesselb committed Sep 13, 2024
1 parent bfa89d5 commit a67f556
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Service/MailFilter/FilterBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ public function buildSieveScript(array $filters, string $untouchedScript): strin
}
}

if (count($tests) === 0) {
// skip filter without tests
continue;
}

$actions = [];
foreach ($filter['actions'] as $action) {
if ($action['type'] === 'fileinto') {
Expand All @@ -82,8 +87,6 @@ public function buildSieveScript(array $filters, string $untouchedScript): strin
}
}

// Error: lib/Service/MailFilter/FilterBuilder.php:88:15: PossiblyUndefinedArrayOffset: Possibly undefined array key $tests[0] on list{0?: non-empty-string} (see https://psalm.dev/167)

if (count($tests) > 1) {
$ifTest = sprintf('%s (%s)', $filter['operator'], implode(', ', $tests));
} else {
Expand Down

0 comments on commit a67f556

Please sign in to comment.