diff --git a/Output/StreamOutput.php b/Output/StreamOutput.php index b46f4d2ca..e94a5eb8b 100644 --- a/Output/StreamOutput.php +++ b/Output/StreamOutput.php @@ -90,7 +90,7 @@ protected function doWrite(string $message, bool $newline): void protected function hasColorSupport(): bool { // Follow https://no-color.org/ - if ('' !== ($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR') ?: '')) { + if ('' !== (($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR'))[0] ?? '')) { return false; } diff --git a/Question/ChoiceQuestion.php b/Question/ChoiceQuestion.php index 0ccad051c..d062ce78d 100644 --- a/Question/ChoiceQuestion.php +++ b/Question/ChoiceQuestion.php @@ -25,14 +25,14 @@ class ChoiceQuestion extends Question private string $errorMessage = 'Value "%s" is invalid'; /** - * @param string $question The question to ask to the user - * @param array $choices The list of available choices - * @param mixed $default The default answer to return + * @param string $question The question to ask to the user + * @param array $choices The list of available choices + * @param string|bool|int|float|null $default The default answer to return */ public function __construct( string $question, private array $choices, - mixed $default = null, + string|bool|int|float|null $default = null, ) { if (!$choices) { throw new \LogicException('Choice question must have at least 1 choice available.'); diff --git a/Resources/completion.bash b/Resources/completion.bash index 0d76eacc3..64c6a338f 100644 --- a/Resources/completion.bash +++ b/Resources/completion.bash @@ -17,7 +17,7 @@ _sf_{{ COMMAND_NAME }}() { done # Use newline as only separator to allow space in completion values - IFS=$'\n' + local IFS=$'\n' local sf_cmd="${COMP_WORDS[0]}" # for an alias, get the real script behind it