1<?php
2/**
3 * Whoops - php errors for cool kids
4 * @author Filipe Dobreira <http://github.com/filp>
5 */
6
7namespace Whoops\Util;
8
9/**
10 * Used as output callable for Symfony\Component\VarDumper\Dumper\HtmlDumper::dump()
11 *
12 * @see TemplateHelper::dump()
13 */
14class HtmlDumperOutput
15{
16    private $output;
17
18    public function __invoke($line, $depth)
19    {
20        // A negative depth means "end of dump"
21        if ($depth >= 0) {
22            // Adds a two spaces indentation to the line
23            $this->output .= str_repeat('  ', $depth) . $line . "\n";
24        }
25    }
26
27    public function getOutput()
28    {
29        return $this->output;
30    }
31
32    public function clear()
33    {
34        $this->output = null;
35    }
36}
37