1<?php
2
3/*
4 * This file is part of Twig.
5 *
6 * (c) Fabien Potencier
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Twig\Profiler\Dumper;
13
14use Twig\Profiler\Profile;
15
16/**
17 * @author Fabien Potencier <fabien@symfony.com>
18 */
19final class TextDumper extends BaseDumper
20{
21    protected function formatTemplate(Profile $profile, $prefix)
22    {
23        return sprintf('%s└ %s', $prefix, $profile->getTemplate());
24    }
25
26    protected function formatNonTemplate(Profile $profile, $prefix)
27    {
28        return sprintf('%s└ %s::%s(%s)', $prefix, $profile->getTemplate(), $profile->getType(), $profile->getName());
29    }
30
31    protected function formatTime(Profile $profile, $percent)
32    {
33        return sprintf('%.2fms/%.0f%%', $profile->getDuration() * 1000, $percent);
34    }
35}
36
37class_alias('Twig\Profiler\Dumper\TextDumper', 'Twig_Profiler_Dumper_Text');
38