diff options
author | Urban Müller | 2017-06-29 13:19:04 +0200 |
---|---|---|
committer | Urban Müller | 2017-06-29 13:19:04 +0200 |
commit | fdc59a09ab47bd5566eefff7fd88d34980044f78 (patch) | |
tree | 56b599d9761e01a5194fd27d0f27982317786a2d | |
parent | 510b78891ca04e7b633bb99ca5eb5332d7d1ca18 (diff) | |
download | itools-fdc59a09ab47bd5566eefff7fd88d34980044f78.tar.gz itools-fdc59a09ab47bd5566eefff7fd88d34980044f78.tar.bz2 itools-fdc59a09ab47bd5566eefff7fd88d34980044f78.zip |
(mostly) avoid removing newlines inside strings
-rw-r--r-- | it_debug.class | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/it_debug.class b/it_debug.class index 0a290b5..89d31e7 100644 --- a/it_debug.class +++ b/it_debug.class @@ -131,7 +131,7 @@ static function dump($args) $item = preg_replace_callback('/\b(1[2345]\d\d\d\d\d\d\d\d)\b(.*)/', function($m) { return $m[1] . $m[2] . " # " . date('Y-m-d H:i:s', $m[1]); }, $item); $item = preg_replace("#(=>?)\s*\n\s*(array|class)#", '$1 $2', $item); # array( and class on same line as key - $item = preg_replace_callback('#array \(\s+([^(){};]{1,100}),\s+\)#', function($m) { return "array (" . preg_replace("#\n\s*#", " ", $m[1]) . ")"; }, $item); # short arrays on 1 line + $item = preg_replace_callback('#array \(\s+([^(){};]{1,100}),\s+\)#', function($m) { return "array (" . preg_replace("#\n\s+#", " ", $m[1]) . ")"; }, $item); # short arrays on 1 line $item = preg_replace('#class (\S+) \{\s+([^({,;]+;)?\s+\}#', 'class $1 { $2 }', $item); # 1-element objects on 1 line #$item = preg_replace('#\{\s*var \$attr#', '{ var $attr', $item); # move $attr on same line $item = preg_replace("#\\(\s*\n\s*\\)#", "()", $item); # empty arrays on 1 line |