File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -92,12 +92,12 @@ private function applyPatch(Patch $patch, string $code): string
92
92
$ statements = [];
93
93
}
94
94
95
- $ declare = null ;
96
- if ($ this ->isFirstStatementStrictTypesDeclare ($ statements )) {
97
- $ declare = array_shift ($ statements );
98
- }
99
-
100
95
foreach ($ patch ->getModifiers () as $ modifier ) {
96
+ $ declare = null ;
97
+ if ($ this ->isFirstStatementStrictTypesDeclare ($ statements )) {
98
+ $ declare = array_shift ($ statements );
99
+ }
100
+
101
101
if ($ modifier instanceof CodeInsertion) {
102
102
$ statements = $ this ->applyCodeInsertion ($ modifier , $ statements );
103
103
}
@@ -109,10 +109,10 @@ private function applyPatch(Patch $patch, string $code): string
109
109
if ($ modifier instanceof Transformer) {
110
110
$ statements = $ modifier ->transform ($ statements );
111
111
}
112
- }
113
112
114
- if ($ declare !== null && !$ this ->isFirstStatementStrictTypesDeclare ($ statements )) {
115
- array_unshift ($ statements , $ declare );
113
+ if ($ declare !== null && !$ this ->isFirstStatementStrictTypesDeclare ($ statements )) {
114
+ array_unshift ($ statements , $ declare );
115
+ }
116
116
}
117
117
118
118
return $ this ->printer ->prettyPrintFile ($ statements );
You can’t perform that action at this time.
0 commit comments