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

File::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 2
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