1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-07-25 02:31:25 +02:00

Update AggregatedCollector.php

This commit is contained in:
Barry vd. Heuvel
2016-04-16 23:11:21 +02:00
parent 1e3359e78e
commit 376767e79d

View File

@@ -23,7 +23,7 @@ use DebugBar\DebugBarException;
* $aggcollector['msg1']->addMessage('hello world');
* </code>
*/
class AggregatedCollector implements DataCollectorInterface, ArrayAccess
class AggregatedCollector implements DataCollectorInterface, ArrayAccess, Resettable
{
protected $name;
@@ -100,6 +100,20 @@ class AggregatedCollector implements DataCollectorInterface, ArrayAccess
return $this->sort;
}
/**
* Reset all aggregated collectors
*
* @return void
*/
public function reset()
{
foreach ($this->collectors as $collector) {
if ($collector instanceof Resettable) {
$collector->reset();
}
}
}
public function collect()
{
$aggregate = array();