summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2016-03-10 16:07:33 +0100
committerUrban Müller2016-03-10 16:07:33 +0100
commitc58c8c2900026271907e46f5241abdc4f95bc033 (patch)
tree82b9708c4166eca214a553b31099e825a42b8797
parent54bba8a1129d5c39c6d1e46e5455b3555358ecb3 (diff)
downloaditools-c58c8c2900026271907e46f5241abdc4f95bc033.tar.gz
itools-c58c8c2900026271907e46f5241abdc4f95bc033.tar.bz2
itools-c58c8c2900026271907e46f5241abdc4f95bc033.zip
strip space from multiple indendations
-rw-r--r--it_debug.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/it_debug.class b/it_debug.class
index eba18fd..02b7e64 100644
--- a/it_debug.class
+++ b/it_debug.class
@@ -130,7 +130,7 @@ static function dump($args)
$item = preg_replace_callback('/\b(1[234]\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 (" . strtr($m[1], array("\n " => "")) . ")"; }, $item); # short arrays on 1 line
+ $item = preg_replace_callback('#array \(\s+([^(){};]{1,100}),\s+\)#', function($m) { return "array (" . it::replace(array("\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