Merge pull request #4791 from jeromegamez/brackets

Add brackets to clarify intent and avoid unwanted side-effects
This commit is contained in:
John Paul E. Balandan, CPA 2021-06-08 00:41:17 +08:00 committed by GitHub
commit e37464be11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -715,7 +715,7 @@ class CLI
// Shells such as `Cygwin` and `Git bash` returns incorrect values
// when executing `mode CON`, so we use `tput` instead
// @codeCoverageIgnoreStart
if (($shell = getenv('SHELL')) && preg_match('/(?:bash|zsh)(?:\.exe)?$/', $shell) || getenv('TERM'))
if (getenv('TERM') || (($shell = getenv('SHELL')) && preg_match('/(?:bash|zsh)(?:\.exe)?$/', $shell)))
{
static::$height = (int) exec('tput lines');
static::$width = (int) exec('tput cols');
@ -1141,7 +1141,7 @@ class CLI
$table .= '| ' . implode(' | ', $tableRows[$row]) . ' |' . PHP_EOL;
// Set the thead and table borders-bottom
if (isset($cols) && ($row === 0 && ! empty($thead) || $row + 1 === $totalRows))
if (isset($cols) && (($row === 0 && ! empty($thead)) || ($row + 1 === $totalRows)))
{
$table .= $cols . PHP_EOL;
}

View File

@ -91,7 +91,7 @@ class Routes extends BaseCollector
$params[] = [
'name' => $param->getName(),
'value' => $router->params()[$key] ??
'<empty>&nbsp| default: ' . var_export($param->isDefaultValueAvailable() ? $param->getDefaultValue() : null, true),
('<empty>&nbsp| default: ' . var_export($param->isDefaultValueAvailable() ? $param->getDefaultValue() : null, true)),
];
}

View File

@ -584,7 +584,7 @@ class Time extends DateTime
{
if ($transition['time'] > $this->format('U'))
{
$daylightSaving = (bool) $transition['isdst'] ?? $daylightSaving;
$daylightSaving = (bool) ($transition['isdst'] ?? $daylightSaving);
break;
}
}