Skip to content

Commit

Permalink
Fix: Sniff only pure indents, no mixed spaces and tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Aug 12, 2018
1 parent 724a061 commit 4861621
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Format/Sniffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private function jsonEncodeOptions(string $json): int

private function indent(string $json): string
{
if (1 === \preg_match('/^(?P<indent>[ \t]+)("|{)/m', $json, $match)) {
if (1 === \preg_match('/^(?P<indent>( +|\t+)).*/m', $json, $match)) {
return $match['indent'];
}

Expand Down

0 comments on commit 4861621

Please sign in to comment.