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

PlainRenderer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 1
b 0
f 0
dl 0
loc 27
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A apply() 0 3 1
A escapeStrings() 0 3 1
A __construct() 0 3 1
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