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 *
19 * @final
20 */
21class TextDumper extends BaseDumper
22{
23    protected function formatTemplate(Profile $profile, $prefix)
24    {
25        return sprintf('%s└ %s', $prefix, $profile->getTemplate());
26    }
27
28    protected function formatNonTemplate(Profile $profile, $prefix)
29    {
30        return sprintf('%s└ %s::%s(%s)', $prefix, $profile->getTemplate(), $profile->getType(), $profile->getName());
31    }
32
33    protected function formatTime(Profile $profile, $percent)
34    {
35        return sprintf('%.2fms/%.0f%%', $profile->getDuration() * 1000, $percent);
36    }
37}
38
39class_alias('Twig\Profiler\Dumper\TextDumper', 'Twig_Profiler_Dumper_Text');
40