Site::getPath()   A
last analyzed

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 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Buttress\Concrete\Locator;
4
5
/**
6
 * A concrete5 site
7
 */
8
final class Site implements SiteInterface
9
{
10
11
    /** @var string The path to the webroot */
12
    private $path;
13
14
    /** @var string The version number */
15
    private $version;
16
17
    /**
18
     * @return mixed
19
     */
20 9
    public function getPath()
21
    {
22 9
        return $this->path;
23
    }
24
25
    /**
26
     * @param mixed $path
27
     * @return Site
28
     */
29 15
    public function setPath($path)
30
    {
31 15
        $this->path = $path;
32 15
        return $this;
33
    }
34
35
    /**
36
     * @return string
37
     */
38 3
    public function getVersion()
39
    {
40 3
        return $this->version;
41
    }
42
43
    /**
44
     * @param string $version
45
     * @return Site
46
     */
47 15
    public function setVersion($version)
48
    {
49 15
        $this->version = $version;
50 15
        return $this;
51
    }
52
53
    /**
54
     * A simple factory method for creating a site object
55
     *
56
     * @param string $path
57
     * @param string $version
58
     * @return Site
59
     */
60 12
    public static function create($path = '', $version = '')
61
    {
62 12
        return (new static)->setVersion($version)->setPath($path);
63
    }
64
}
65