Passed
Push — master ( 67aa31...d47bdf )
by Kirill
03:20
created

PlainRenderer::escapeStrings()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Debug\Renderer;
13
14
/**
15
 * No styles.
16
 */
17
final class PlainRenderer extends AbstractRenderer
18
{
19
    /** @var bool */
20
    private $escapeStrings = false;
21
22
    /**
23
     * @param bool $escapeStrings
24
     */
25
    public function __construct(bool $escapeStrings = true)
26
    {
27
        $this->escapeStrings = $escapeStrings;
28
    }
29
30
    /**
31
     * @inheritdoc
32
     */
33
    public function apply($element, string $type, string $context = ''): string
34
    {
35
        return (string)$element;
36
    }
37
38
    /**
39
     * @inheritdoc
40
     */
41
    public function escapeStrings(): bool
42
    {
43
        return $this->escapeStrings;
44
    }
45
}
46