File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed
Tests/Fixtures/Style/SymfonyStyle Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,14 @@ class OutputFormatter implements WrappableOutputFormatterInterface
2525 private $ styles = [];
2626 private $ styleStack ;
2727
28+ public function __clone ()
29+ {
30+ $ this ->styleStack = clone $ this ->styleStack ;
31+ foreach ($ this ->styles as $ key => $ value ) {
32+ $ this ->styles [$ key ] = clone $ value ;
33+ }
34+ }
35+
2836 /**
2937 * Escapes "<" special char in given text.
3038 *
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use Symfony \Component \Console \Input \InputInterface ;
4+ use Symfony \Component \Console \Output \OutputInterface ;
5+ use Symfony \Component \Console \Style \SymfonyStyle ;
6+
7+ // Ensure that closing tag is applied once
8+ return function (InputInterface $ input , OutputInterface $ output ) {
9+ $ output ->setDecorated (true );
10+ $ output = new SymfonyStyle ($ input , $ output );
11+ $ output ->write ('<question>do you want <comment>something</> ' );
12+ $ output ->writeln ('?</> ' );
13+ };
Original file line number Diff line number Diff line change 1+ [30;46mdo you want [39;49m[33msomething[39m[30;46m?[39;49m
You can’t perform that action at this time.
0 commit comments