From bc5e15996adbeb2aebf0413a37e165ed7750f4c5 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sun, 11 Jul 2021 23:48:16 +0200 Subject: [PATCH] convert single case switch to if statement --- lib-php/cmd.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib-php/cmd.php b/lib-php/cmd.php index 07000478..a52e8fce 100644 --- a/lib-php/cmd.php +++ b/lib-php/cmd.php @@ -100,12 +100,8 @@ function getCmdOpt($aArg, $aSpec, &$aResult, $bExitOnError = false, $bExitOnUnkn if ($aCounts[$aLine[0]] > $aLine[3]) { showUsage($aSpec, $bExitOnError, 'Option \''.$aLine[0].'\' is pressent too many times'); } - switch ($aLine[6]) { - case 'bool': - if (!array_key_exists($aLine[0], $aResult)) { - $aResult[$aLine[0]] = false; - } - break; + if ($aLine[6] == 'bool' && !array_key_exists($aLine[0], $aResult)) { + $aResult[$aLine[0]] = false; } } } -- 2.39.5