From e8df859da2894fb29cacce43ba9940b329fc1e57 Mon Sep 17 00:00:00 2001 From: Andrew Engelbrecht Date: Sun, 29 Apr 2018 23:37:18 -0400 Subject: better whitespace handling by ./cli locale:compare --- app/Console/LocaleComparatorCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/Console') diff --git a/app/Console/LocaleComparatorCommand.php b/app/Console/LocaleComparatorCommand.php index de83714f..fd29d13e 100644 --- a/app/Console/LocaleComparatorCommand.php +++ b/app/Console/LocaleComparatorCommand.php @@ -63,11 +63,11 @@ class LocaleComparatorCommand extends BaseCommand $content = file_get_contents($filename); $strings = array(); - if (preg_match_all('/\b[et]\((\'\K.*?\') *[\)\,]/', $content, $matches) && isset($matches[1])) { + if (preg_match_all('/\b[et]\s*\(\s*(\'\K.*?\')\s*[\)\,]/', $content, $matches) && isset($matches[1])) { $strings = $matches[1]; } - if (preg_match_all('/\bdt\((\'\K.*?\') *[\)\,]/', $content, $matches) && isset($matches[1])) { + if (preg_match_all('/\bdt\s*\(\s*(\'\K.*?\')\s*[\)\,]/', $content, $matches) && isset($matches[1])) { $strings = array_merge($strings, $matches[1]); } -- cgit v1.2.3