Skip to content

Commit 0797564

Browse files
author
Julien Brochet
committed
[Check CS] don't replace 'else if' on twig files (closes symfony#2961)
1 parent f458e96 commit 0797564

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

check_cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ foreach ($finder as $file) {
9494
}
9595

9696
// [Structure] elseif, not else if
97-
$new = preg_replace('/} else if \(/', '} elseif (', $new);
97+
if ('twig' !== $file->getExtension()) {
98+
$new = preg_replace('/} else if \(/', '} elseif (', $new);
99+
}
98100

99101
if ($new != $old) {
100102
$count++;

0 commit comments

Comments
 (0)