mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Merge pull request #4791 from jeromegamez/brackets
Add brackets to clarify intent and avoid unwanted side-effects
This commit is contained in:
commit
e37464be11
@ -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;
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ class Routes extends BaseCollector
|
||||
$params[] = [
|
||||
'name' => $param->getName(),
|
||||
'value' => $router->params()[$key] ??
|
||||
'<empty> | default: ' . var_export($param->isDefaultValueAvailable() ? $param->getDefaultValue() : null, true),
|
||||
('<empty> | default: ' . var_export($param->isDefaultValueAvailable() ? $param->getDefaultValue() : null, true)),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user