Skip to content

Commit 01edfba

Browse files
Merge branch '6.4' into 7.3
* 6.4: Fix inline var annotations [Console][Table] Don't split grapheme clusters [FrameworkBundle] Fix block type from `OK` to `ERROR` when local vault is disabled in `SecretsGenerateKeysCommand` [FrameworkBundle] Add tests for `secrets:decrypt-to-local`, `encrypt-from-local`, and `generate-keys` commands Reflection*::setAccessible() has no effect as of PHP 8.1
2 parents 5f360eb + 0ca45ae commit 01edfba

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Formatter/OutputFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,6 @@ private function addLineBreaks(string $text, int $width): string
275275
{
276276
$encoding = mb_detect_encoding($text, null, true) ?: 'UTF-8';
277277

278-
return b($text)->toCodePointString($encoding)->wordwrap($width, "\n", true)->toByteString($encoding);
278+
return b($text)->toUnicodeString($encoding)->wordwrap($width, "\n", true)->toByteString($encoding);
279279
}
280280
}

Tests/Formatter/OutputFormatterTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ public function testFormatAndWrap()
373373
$this->assertSame("foobar\e[37;41mbaz\e[39;49m\n\e[37;41mnewline\e[39;49m", $formatter->formatAndWrap("foobar<error>baz\nnewline</error>", 11));
374374
$this->assertSame("foobar\e[37;41mbazne\e[39;49m\n\e[37;41mwline\e[39;49m", $formatter->formatAndWrap("foobar<error>bazne\nwline</error>", 11));
375375
$this->assertSame("foobar\e[37;41mbazne\e[39;49m\n\e[37;41mw\e[39;49m\n\e[37;41mline\e[39;49m", $formatter->formatAndWrap("foobar<error>baznew\nline</error>", 11));
376+
$this->assertSame("\e[37;41m👩‍🌾\e[39;49m", $formatter->formatAndWrap('<error>👩‍🌾</error>', 1));
376377

377378
$formatter = new OutputFormatter();
378379

@@ -392,6 +393,7 @@ public function testFormatAndWrap()
392393
$this->assertSame("foobarbaz\nnewline", $formatter->formatAndWrap("foobar<error>baz\nnewline</error>", 11));
393394
$this->assertSame("foobarbazne\nwline", $formatter->formatAndWrap("foobar<error>bazne\nwline</error>", 11));
394395
$this->assertSame("foobarbazne\nw\nline", $formatter->formatAndWrap("foobar<error>baznew\nline</error>", 11));
396+
$this->assertSame('👩‍🌾', $formatter->formatAndWrap('👩‍🌾', 1));
395397
}
396398
}
397399

0 commit comments

Comments
 (0)