Skip to content

Commit f2fa046

Browse files
committed
bug #19189 [Console] Fix formatting of SymfonyStyle::comment() (chalasr)
This PR was merged into the 2.8 branch. Discussion ---------- [Console] Fix formatting of SymfonyStyle::comment() | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #19172 | License | MIT | Doc PR | n/a This: ```php $io->comment('Lorem ipsum dolor sit amet, consectetur adipisicing elit, <comment>sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat </comment>cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'); ``` Before outputs: ![](http://image.prntscr.com/image/1d2ea9de42024b53a77120c482be51d4.png) After: ![](http://image.prntscr.com/image/36de23ec14b64804b0cbae7a431185be.png) This moves the lines-cutting logic from `block()` into a specific `createBlock`, used from both `comment()` and `block()`, sort as `comment()` can take messages containing nested tags and outputs a correctly formatted block without escaping tags. Commits ------- 0a53e1d [Console] Fix formatting of SymfonyStyle::comment()
2 parents 812275b + 739be71 commit f2fa046

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Tests/Fixtures/Descriptor/alias_1.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
// This service is an alias for the service service_1
2+
 // This service is an alias for the service service_1
33

Tests/Fixtures/Descriptor/alias_2.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
// This service is an alias for the service service_2
2+
 // This service is an alias for the service service_2
33

0 commit comments

Comments
 (0)