public static function generate(Profiler $profiler, AggregateInterface $aggregator) { foreach ($profiler->getProfiles() as $profile) { $aggregator->processProfile($profile); } return $aggregator; }
public function testProfiler() { $prof = new Profiler(); $prof->start(); $this->assertCount(0, $prof->getProfiles()); $prof->end(); $this->assertCount(1, $prof->getProfiles()); $this->assertInstanceOf("Dux\\Profile", current($prof->getProfiles())); }