Skip to content

Commit

Permalink
Use ??= more
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Nov 2, 2022
1 parent 00db88f commit ba6e553
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -1204,11 +1204,7 @@ public static function isTtySupported(): bool
{
static $isTtySupported;

if (null === $isTtySupported) {
$isTtySupported = ('/' === \DIRECTORY_SEPARATOR && stream_isatty(\STDOUT));
}

return $isTtySupported;
return $isTtySupported ??= ('/' === \DIRECTORY_SEPARATOR && stream_isatty(\STDOUT));
}

/**
Expand Down

0 comments on commit ba6e553

Please sign in to comment.