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

File   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 5
Bugs 1 Features 1
Metric Value
wmc 4
c 5
b 1
f 1
lcom 2
cbo 2
dl 0
loc 46
ccs 10
cts 10
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getLocation() 0 4 1
A getRawContent() 0 4 1
A __toString() 0 4 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