Total Complexity | 6 |
Total Lines | 57 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
13 | class Directories |
||
14 | { |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | private $project; |
||
19 | |||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | private $server; |
||
24 | |||
25 | /** |
||
26 | * Directories constructor. |
||
27 | * |
||
28 | * @param array $server |
||
29 | * @param string $project directory |
||
30 | */ |
||
31 | 6 | public function __construct(array $server, $project) |
|
32 | { |
||
33 | 6 | if (!basename($project)) { |
|
34 | 1 | throw new InvalidArgumentException(sprintf('Invalid project directory "%s"', $project)); |
|
35 | } |
||
36 | |||
37 | 5 | $this->project = $project; |
|
38 | |||
39 | 5 | if (!isset($server['HOME'])) { |
|
40 | 1 | throw new InvalidArgumentException('Server must contain a "HOME" entry'); |
|
41 | } |
||
42 | |||
43 | 4 | $this->server = $server; |
|
44 | 4 | } |
|
45 | |||
46 | /** |
||
47 | * basename of the project directory |
||
48 | * |
||
49 | * @return string |
||
50 | */ |
||
51 | 2 | public function getName() |
|
52 | { |
||
53 | 2 | return basename($this->project); |
|
54 | } |
||
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | */ |
||
59 | 1 | public function getProject() |
|
60 | { |
||
61 | 1 | return $this->project; |
|
62 | } |
||
63 | |||
64 | /** |
||
65 | * @return string |
||
66 | */ |
||
67 | 1 | public function getPipelineLocalDeploy() |
|
70 | } |
||
71 | } |
||
72 |