@@ -64,8 +64,9 @@ protected function configure()
64
64
*/
65
65
protected function execute (InputInterface $ input , OutputInterface $ output ): int
66
66
{
67
- $ xml = ($ input ->getOption ('xml ' )) ? '--xml ' : "" ;
68
- $ noAnsi = ($ input ->getOption ('no-ansi ' )) ? '--no-ansi ' : "" ;
67
+ $ xml = ($ input ->getOption ('xml ' ))
68
+ ? '--xml '
69
+ : "" ;
69
70
$ skipGeneration = $ input ->getOption ('skip-generate ' );
70
71
$ force = $ input ->getOption ('force ' );
71
72
$ groups = $ input ->getArgument ('groups ' );
@@ -135,8 +136,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
135
136
$ process ->setIdleTimeout (600 );
136
137
$ process ->setTimeout (0 );
137
138
$ returnCodes [] = $ process ->run (
138
- function ($ type , $ buffer ) use ($ output , $ noAnsi ) {
139
- $ buffer = $ this ->disableAnsiColorCodes ($ buffer , $ noAnsi );
139
+ function ($ type , $ buffer ) use ($ output ) {
140
140
$ output ->write ($ buffer );
141
141
}
142
142
);
@@ -159,19 +159,4 @@ function ($type, $buffer) use ($output, $noAnsi) {
159
159
}
160
160
return max ($ exitCode , $ generationErrorCode );
161
161
}
162
-
163
- /**
164
- * @param string $buffer
165
- * @param string $noAnsi
166
- * @return string
167
- */
168
- private function disableAnsiColorCodes ($ buffer , $ noAnsi ) :string
169
- {
170
- if (empty ($ noAnsi )) {
171
- return $ buffer ;
172
- }
173
- $ pattern = "/ \x1B\[([0-9]{1,2}(;[0-9]{1,2})*)?[m|K]/ " ;
174
- // Use preg_replace to remove ANSI escape codes from the string
175
- return preg_replace ($ pattern , '' , $ buffer );
176
- }
177
162
}
0 commit comments