Skip to content

Commit

Permalink
php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasmullie committed Nov 26, 2018
1 parent 97f118c commit d5acb8c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/JS.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,15 +345,19 @@ protected function stripWhitespace($content)
array(
'/('.implode('|', $operatorsBefore).')\s+/',
'/\s+('.implode('|', $operatorsAfter).')/',
), '\\1', $content
),
'\\1',
$content
);

// make sure + and - can't be mistaken for, or joined into ++ and --
$content = preg_replace(
array(
'/(?<![\+\-])\s*([\+\-])(?![\+\-])/',
'/(?<![\+\-])([\+\-])\s*(?![\+\-])/',
), '\\1', $content
),
'\\1',
$content
);

// collapse whitespace around reserved words into single space
Expand Down

0 comments on commit d5acb8c

Please sign in to comment.