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
9292 $ statements = [];
9393 }
9494
95- $ declare = null ;
96- if ($ this ->isFirstStatementStrictTypesDeclare ($ statements )) {
97- $ declare = array_shift ($ statements );
98- }
99-
10095 foreach ($ patch ->getModifiers () as $ modifier ) {
96+ $ declare = null ;
97+ if ($ this ->isFirstStatementStrictTypesDeclare ($ statements )) {
98+ $ declare = array_shift ($ statements );
99+ }
100+
101101 if ($ modifier instanceof CodeInsertion) {
102102 $ statements = $ this ->applyCodeInsertion ($ modifier , $ statements );
103103 }
@@ -109,10 +109,10 @@ private function applyPatch(Patch $patch, string $code): string
109109 if ($ modifier instanceof Transformer) {
110110 $ statements = $ modifier ->transform ($ statements );
111111 }
112- }
113112
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+ }
116116 }
117117
118118 return $ this ->printer ->prettyPrintFile ($ statements );
You can’t perform that action at this time.
0 commit comments