public function testConstructor() { $profile = new Twig_Profiler_Profile('template', 'type', 'name'); $this->assertEquals('template', $profile->getTemplate()); $this->assertEquals('type', $profile->getType()); $this->assertEquals('name', $profile->getName()); }
private function format(\Twig_Profiler_Profile $profile) { $tmp = array(); $tmp["template"] = $profile->getTemplate(); $tmp["name"] = $profile->getName(); $tmp["duration"] = $profile->getDuration(); $tmp["type"] = $profile->getType(); return $tmp; }
protected function formatNonTemplate(Twig_Profiler_Profile $profile, $prefix) { return sprintf('%s└ %s::%s(%s)', $prefix, $profile->getTemplate(), $profile->getType(), $profile->getName()); }
protected function formatNonTemplate(Twig_Profiler_Profile $profile, $prefix) { return sprintf('%s└ %s::%s(<span style="background-color: %s">%s</span>)', $prefix, $profile->getTemplate(), $profile->getType(), isset(self::$colors[$profile->getType()]) ? self::$colors[$profile->getType()] : 'auto', $profile->getName()); }
protected function incTemplateCount(\Twig_Profiler_Profile $p, $templates) { if ($p->isTemplate()) { if (!isset($templates[$p->getTemplate()])) { $templates[$p->getTemplate()] = 1; } else { ++$templates[$p->getTemplate()]; } } return $templates; }