always use brackets on if statements

This adds bracket around all one-line if statements that did
not have them yet.
This commit is contained in:
Sarah Hoffmann
2021-07-10 14:59:38 +02:00
parent 500c61685b
commit 27af9b102c
26 changed files with 377 additions and 144 deletions

View File

@@ -33,7 +33,9 @@ class Shell
public function addEnvPair($sKey, $sVal)
{
if (isset($sKey) && $sKey && isset($sVal)) {
if (!isset($this->aEnv)) $this->aEnv = $_ENV;
if (!isset($this->aEnv)) {
$this->aEnv = $_ENV;
}
$this->aEnv = array_merge($this->aEnv, array($sKey => $sVal), $_ENV);
}
return $this;
@@ -75,11 +77,8 @@ class Shell
return $iStat;
}
private function escapeParam($sParam)
{
if (preg_match('/^-*\w+$/', $sParam)) return $sParam;
return escapeshellarg($sParam);
return (preg_match('/^-*\w+$/', $sParam)) ? $sParam : escapeshellarg($sParam);
}
}