Completed
Push — master ( 49c7da...61b9c9 )
by Victor
13s
created

File   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 52
ccs 0
cts 21
cp 0
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getPath() 0 4 1
A getRawContent() 0 4 1
A setRawContent() 0 4 1
A __toString() 0 4 1
1
<?php
2
3
namespace LazyEight\DiTesto;
4
5
use LazyEight\DiTesto\Interfaces\FileInterface;
6
7
class File implements FileInterface
8
{
9
    /**
10
     * @var string
11
     */
12
    private $path;
13
14
    /**
15
     * @var string
16
     */
17
    private $content;
18
19
    /**
20
     * File constructor.
21
     * @param string $path
22
     * @param string $content
23
     */
24
    public function __construct(string $path, string $content = '')
25
    {
26
        $this->path = $path;
27
        $this->content = $content;
28
    }
29
30
    /**
31
     * @inheritDoc
32
     */
33
    public function getPath(): string
34
    {
35
        return $this->path;
36
    }
37
38
    /**
39
     * @inheritDoc
40
     */
41
    public function getRawContent(): string
42
    {
43
        return $this->content;
44
    }
45
46
    /**
47
     * @inheritDoc
48
     */
49
    public function setRawContent(string $content)
50
    {
51
        $this->content = $content;
52
    }
53
54
    public function __toString()
55
    {
56
        return (string) $this->content;
57
    }
58
}
59