From 075ea6490f7b26831b51839176d6284ea5c839cc Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Mar 2021 13:24:21 +0100 Subject: [PATCH] [Console] minor fix --- Helper/QuestionHelper.php | 2 +- Style/SymfonyStyle.php | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Helper/QuestionHelper.php b/Helper/QuestionHelper.php index d211fcfd1..6dde580cf 100644 --- a/Helper/QuestionHelper.php +++ b/Helper/QuestionHelper.php @@ -309,7 +309,7 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu $remainingCharacters = substr($ret, \strlen(trim($this->mostRecentlyEnteredValue($fullChoice)))); $output->write($remainingCharacters); $fullChoice .= $remainingCharacters; - $i = self::strlen($fullChoice); + $i = (false === $encoding = mb_detect_encoding($fullChoice, null, true)) ? \strlen($fullChoice) : mb_strlen($fullChoice, $encoding); $matches = array_filter( $autocomplete($ret), diff --git a/Style/SymfonyStyle.php b/Style/SymfonyStyle.php index ba89fb422..ecdf9b1a3 100644 --- a/Style/SymfonyStyle.php +++ b/Style/SymfonyStyle.php @@ -496,8 +496,6 @@ private function createBlock(iterable $messages, string $type = null, string $st } $line = $prefix.$line; - $decorationLength = Helper::strlen($line) - Helper::strlenWithoutDecoration($this->getFormatter(), $line); - $messageLineLength = min($this->lineLength - $prefixLength - $indentLength + $decorationLength, $this->lineLength); $line .= str_repeat(' ', max($this->lineLength - Helper::strlenWithoutDecoration($this->getFormatter(), $line), 0)); if ($style) {