File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -155,24 +155,21 @@ public function getDumpsCount()
155
155
156
156
public function getDumps ($ format , $ maxDepthLimit = -1 , $ maxItemsPerDepth = -1 )
157
157
{
158
+ $ data = fopen ('php://memory ' 'r+b');
159
+
158
160
if ( ' html' === $ format ) {
159
- $ dumper = new HtmlDumper ();
161
+ $ dumper = new HtmlDumper ($ data );
160
162
} else {
161
163
throw new \InvalidArgumentException (sprintf ('Invalid dump format: %s ' , $ format ));
162
164
}
163
165
$ dumps = array ();
164
166
165
167
foreach ($ this ->data as $ dump ) {
166
- $ data = '' ;
167
- $ dumper ->dump (
168
- $ dump ['data ' ]->getLimitedClone ($ maxDepthLimit , $ maxItemsPerDepth ),
169
- function ($ line , $ depth ) use (&$ data ) {
170
- if (-1 !== $ depth ) {
171
- $ data .= str_repeat (' ' , $ depth ).$ line ."\n" ;
172
- }
173
- }
174
- );
175
- $ dump ['data ' ] = $ data ;
168
+ $ dumper ->dump ($ dump ['data ' ]->getLimitedClone ($ maxDepthLimit , $ maxItemsPerDepth ));
169
+ rewind ($ data );
170
+ $ dump ['data ' ] = stream_get_contents ($ data );
171
+ ftruncate ($ data , 0 );
172
+ rewind ($ data );
176
173
$ dumps [] = $ dump ;
177
174
}
178
175
You can’t perform that action at this time.
0 commit comments