File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 29
29
use SebastianBergmann \Diff \Output \UnifiedDiffOutputBuilder ;
30
30
use function get_class ;
31
31
use function sha1 ;
32
+ use function str_contains ;
32
33
use function str_repeat ;
33
34
34
35
#[AutowiredService]
@@ -137,7 +138,12 @@ public function transform(
137
138
$ newStmts = $ traverser ->traverse ($ newStmts );
138
139
139
140
if ($ visitor ->isFound ()) {
140
- $ printer = new PhpPrinter (['indent ' => str_repeat ($ indentDetector ->indentCharacter , $ indentDetector ->indentSize )]);
141
+ if (str_contains ($ indentDetector ->indentCharacter , "\t" )) {
142
+ $ indent = "\t" ;
143
+ } else {
144
+ $ indent = str_repeat ($ indentDetector ->indentCharacter , $ indentDetector ->indentSize );
145
+ }
146
+ $ printer = new PhpPrinter (['indent ' => $ indent ]);
141
147
$ newCode = $ printer ->printFormatPreserving ($ newStmts , $ fileNodes , $ oldTokens );
142
148
143
149
if ($ oldCode !== $ newCode ) {
You can’t perform that action at this time.
0 commit comments