summaryrefslogtreecommitdiffstats
path: root/core/Command
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-11-07 11:21:46 +0100
committerJohn Molakvoæ <skjnldsv@protonmail.com>2022-12-29 12:36:34 +0100
commit9430899f163d0c07ce31d674bd345a9f672245ea (patch)
tree0522db19afc154e07845e6c5aabf3c3e86fc9c0c /core/Command
parente6b56a425b4f6bdeebf311c04a79438f2ccabf12 (diff)
downloadnextcloud-server-9430899f163d0c07ce31d674bd345a9f672245ea.tar.gz
nextcloud-server-9430899f163d0c07ce31d674bd345a9f672245ea.zip
Fix psalm issues related to signature changes from PHP 8.0
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'core/Command')
-rw-r--r--core/Command/Log/Manage.php50
1 files changed, 23 insertions, 27 deletions
diff --git a/core/Command/Log/Manage.php b/core/Command/Log/Manage.php
index 34ec5ea54a8..63a8efde370 100644
--- a/core/Command/Log/Manage.php
+++ b/core/Command/Log/Manage.php
@@ -141,18 +141,18 @@ class Manage extends Command implements CompletionAwareInterface {
protected function convertLevelString($level) {
$level = strtolower($level);
switch ($level) {
- case 'debug':
- return 0;
- case 'info':
- return 1;
- case 'warning':
- case 'warn':
- return 2;
- case 'error':
- case 'err':
- return 3;
- case 'fatal':
- return 4;
+ case 'debug':
+ return 0;
+ case 'info':
+ return 1;
+ case 'warning':
+ case 'warn':
+ return 2;
+ case 'error':
+ case 'err':
+ return 3;
+ case 'fatal':
+ return 4;
}
throw new \InvalidArgumentException('Invalid log level string');
}
@@ -164,16 +164,16 @@ class Manage extends Command implements CompletionAwareInterface {
*/
protected function convertLevelNumber($levelNum) {
switch ($levelNum) {
- case 0:
- return 'Debug';
- case 1:
- return 'Info';
- case 2:
- return 'Warning';
- case 3:
- return 'Error';
- case 4:
- return 'Fatal';
+ case 0:
+ return 'Debug';
+ case 1:
+ return 'Info';
+ case 2:
+ return 'Warning';
+ case 3:
+ return 'Error';
+ case 4:
+ return 'Fatal';
}
throw new \InvalidArgumentException('Invalid log level number');
}
@@ -189,11 +189,7 @@ class Manage extends Command implements CompletionAwareInterface {
} elseif ($optionName === 'level') {
return ['debug', 'info', 'warning', 'error', 'fatal'];
} elseif ($optionName === 'timezone') {
- $identifier = \DateTimeZone::listIdentifiers();
- if ($identifier === false) {
- return [];
- }
- return $identifier;
+ return \DateTimeZone::listIdentifiers();
}
return [];
}