Completed
Push — master ( 0049d7...435a83 )
by Victor
01:48
created

File::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Created with PHP 5.6 generator
4
 * User: 
5
 * PHP 5.6 generator created by Victor MECH - April 2016
6
*/
7
8
namespace LazyEight\DiTesto\ValueObject;
9
10
11
class File
12
{
13
    /*
14
     * @var FileLocation
15
     */
16
    private $location;
17
    
18
    /*
19
     * @var FileContent
20
     */
21
    private $content;
22
23
    /**
24
     * @param FileLocation $location
25
     * @param FileContent $content
26
     */
27 1
    public function __construct(FileLocation $location, FileContent $content)
28
    {
29 1
        $this->location = $location;
30 1
        $this->content = $content;
31 1
    }
32
	
33
    /**
34
     * @return FileLocation The location of the file on disk
35
     */
36 1
    public function getLocation()
37
    {
38 1
        return clone $this->location;
39
    }
40
41
    /**
42
     * @return FileContent Raw content of the file
43
     */
44 1
    public function getRawContent()
45
    {
46 1
        return clone $this->content;
47
    }
48
49
    /**
50
     * @var string
51
     */
52 1
    public function __toString()
53
    {
54 1
        return $this->getRawContent()->getValue()->getValue();
55
    }
56
}
57