Completed
Pull Request — master (#10)
by Tomáš
04:48 queued 01:50
created

FormatContext   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 44
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A templateId() 0 4 1
A template() 0 4 1
A data() 0 4 1
A formatter() 0 4 1
1
<?php
2
3
/*
4
 * This file is a part of Sculpin.
5
 *
6
 * (c) Dragonfly Development Inc.
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Symplify\PHP7_Sculpin\Formatter;
13
14
use Dflydev\DotAccessConfiguration\Configuration;
15
16
final class FormatContext
17
{
18
    /**
19
     * @var string
20
     */
21
    private $templateId;
22
23
    /**
24
     * @var string
25
     */
26
    private $template;
27
28
    /**
29
     * @var Configuration
30
     */
31
    private $data;
32
33 1
    public function __construct(string $templateId, string $template, array $data)
34
    {
35 1
        $this->templateId = $templateId;
36 1
        $this->template = $template;
37 1
        $this->data = new Configuration($data);
38 1
    }
39
40 1
    public function templateId() : string
41
    {
42 1
        return $this->templateId;
43
    }
44
45 1
    public function template() : string
46
    {
47 1
        return $this->template;
48
    }
49
50 1
    public function data() : Configuration
51
    {
52 1
        return $this->data;
53
    }
54
55 1
    public function formatter() : string
56
    {
57 1
        return $this->data->get('formatter');
58
    }
59
}
60