File tree 3 files changed +22
-0
lines changed
src/Symfony/Component/Console
Tests/Fixtures/Style/SymfonyStyle 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
25
25
private $ styles = [];
26
26
private $ styleStack ;
27
27
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
+
28
36
/**
29
37
* Escapes "<" special char in given text.
30
38
*
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