Skip to content

Commit b72681c

Browse files
[VarDumper] with-er interface for Cloner\Data
1 parent 78b9ad7 commit b72681c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

DataCollector/DumpDataCollector.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,12 @@ public function getDumps($format, $maxDepthLimit = -1, $maxItemsPerDepth = -1)
168168
$dumps = array();
169169

170170
foreach ($this->data as $dump) {
171-
$dumper->dump($dump['data']->getLimitedClone($maxDepthLimit, $maxItemsPerDepth));
171+
if (method_exists($dump['data'], 'withMaxDepth')) {
172+
$dumper->dump($dump['data']->withMaxDepth($maxDepthLimit)->withMaxItemsPerDepth($maxItemsPerDepth));
173+
} else {
174+
// getLimitedClone is @deprecated, to be removed in 3.0
175+
$dumper->dump($dump['data']->getLimitedClone($maxDepthLimit, $maxItemsPerDepth));
176+
}
172177
rewind($data);
173178
$dump['data'] = stream_get_contents($data);
174179
ftruncate($data, 0);

0 commit comments

Comments
 (0)