Completed
Push — master ( 7c9eb0...a92430 )
by Thomas
13s
created

getFileLinkFormat()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the ekino Drupal Debug project.
7
 *
8
 * (c) ekino
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Ekino\Drupal\Debug\Action\DisplayPrettyExceptionsASAP;
15
16
use Ekino\Drupal\Debug\Configuration\Model\DefaultsConfiguration;
17
use Ekino\Drupal\Debug\Option\OptionsInterface;
18
19
class DisplayPrettyExceptionsASAPOptions implements OptionsInterface
20
{
21
    /**
22
     * @var string|null
23
     */
24
    private $charset;
25
26
    /**
27
     * @var string|null
28
     */
29
    private $fileLinkFormat;
30
31
    /**
32
     * @param string|null $charset
33
     * @param string|null $fileLinkFormat
34
     */
35 9
    public function __construct(?string $charset, ?string $fileLinkFormat)
36
    {
37 9
        $this->charset = $charset;
38 9
        $this->fileLinkFormat = $fileLinkFormat;
39 9
    }
40
41
    /**
42
     * @return string|null
43
     */
44 2
    public function getCharset(): ?string
45
    {
46 2
        return $this->charset;
47
    }
48
49
    /**
50
     * @return string|null
51
     */
52 2
    public function getFileLinkFormat(): ?string
53
    {
54 2
        return $this->fileLinkFormat;
55
    }
56
57
    /**
58
     * @param string                $appRoot
59
     * @param DefaultsConfiguration $defaultsConfiguration
60
     *
61
     * @return DisplayPrettyExceptionsASAPOptions
62
     */
63 3
    public static function getDefault(string $appRoot, DefaultsConfiguration $defaultsConfiguration): OptionsInterface
64
    {
65 3
        return new self($defaultsConfiguration->getCharset(), $defaultsConfiguration->getFileLinkFormat());
66
    }
67
}
68