diff options
author | Urban Müller | 2016-02-24 18:57:46 +0100 |
---|---|---|
committer | Urban Müller | 2016-02-24 18:58:40 +0100 |
commit | 2d839993577f953e55f308545aa815b350c10a87 (patch) | |
tree | 0e7d88f844c5eb53bc362c05d00267ac8be3c044 /it_debug.class | |
parent | 2a6868c85156c17c0cd7ec0c91921446b3097db5 (diff) | |
download | itools-2d839993577f953e55f308545aa815b350c10a87.tar.gz itools-2d839993577f953e55f308545aa815b350c10a87.tar.bz2 itools-2d839993577f953e55f308545aa815b350c10a87.zip |
have ED show short arrays on one line
Diffstat (limited to 'it_debug.class')
-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 89d5259..9e7b913 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('#array \(\s+([^({,;]+),\s+\)#', 'array( $1 )', $item); # 1-element arrays on 1 line + $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('#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 |