Skip to content

Commit

Permalink
Adapt to new API
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 Oct 24, 2023
1 parent 309519b commit 08be180
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/SetupChecks/LogErrors.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ public function run(): SetupResult {
$count[$logItem['level']]++;

Check warning on line 72 in lib/SetupChecks/LogErrors.php

View check run for this annotation

Codecov / codecov/patch

lib/SetupChecks/LogErrors.php#L72

Added line #L72 was not covered by tests
}
if (array_sum($count) === 0) {
return new SetupResult(SetupResult::SUCCESS, $this->l10n->t('No errors in the logs since %s', $this->dateFormatter->formatDate($limit)));
return SetupResult::success($this->l10n->t('No errors in the logs since %s', $this->dateFormatter->formatDate($limit)));
} elseif ($count[self::LEVEL_ERROR] + $count[self::LEVEL_FATAL] > 0) {
return new SetupResult(
SetupResult::ERROR,
return SetupResult::error(
$this->l10n->n(
'%n error in the logs since %s',
'%n errors in the logs since %s',
Expand All @@ -84,8 +83,7 @@ public function run(): SetupResult {
)
);

Check warning on line 84 in lib/SetupChecks/LogErrors.php

View check run for this annotation

Codecov / codecov/patch

lib/SetupChecks/LogErrors.php#L74-L84

Added lines #L74 - L84 were not covered by tests
} else {
return new SetupResult(
SetupResult::WARNING,
return SetupResult::warning(
$this->l10n->n(
'%n warning in the logs since %s',
'%n warnings in the logs since %s'.json_encode($count),
Expand Down

0 comments on commit 08be180

Please sign in to comment.