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 2929use SebastianBergmann \Diff \Output \UnifiedDiffOutputBuilder ;
3030use function get_class ;
3131use function sha1 ;
32+ use function str_contains ;
3233use function str_repeat ;
3334
3435#[AutowiredService]
@@ -137,7 +138,12 @@ public function transform(
137138 $ newStmts = $ traverser ->traverse ($ newStmts );
138139
139140 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 ]);
141147 $ newCode = $ printer ->printFormatPreserving ($ newStmts , $ fileNodes , $ oldTokens );
142148
143149 if ($ oldCode !== $ newCode ) {
You can’t perform that action at this time.
0 commit comments