Total Complexity | 7 |
Total Lines | 63 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
17 | class Project |
||
18 | { |
||
19 | /** |
||
20 | * @var string path to the project directory on user/host system |
||
21 | */ |
||
22 | private $path; |
||
23 | |||
24 | /** |
||
25 | * @var string prefix ('pipelines' by default) |
||
26 | */ |
||
27 | private $prefix; |
||
28 | |||
29 | /** |
||
30 | * Project constructor. |
||
31 | * |
||
32 | * @param string $path |
||
33 | */ |
||
34 | 5 | public function __construct($path) |
|
35 | { |
||
36 | 5 | $buffer = LibFsPath::normalize($path); |
|
37 | 5 | if (!basename($buffer)) { |
|
38 | 1 | throw new InvalidArgumentException(sprintf('Invalid project directory: "%s"', $path)); |
|
39 | } |
||
40 | 4 | $this->path = $buffer; |
|
41 | 4 | } |
|
42 | |||
43 | /** |
||
44 | * |
||
45 | */ |
||
46 | 1 | public function __toString() |
|
49 | } |
||
50 | |||
51 | 2 | public function getName() |
|
52 | { |
||
53 | 2 | return basename($this->path); |
|
54 | } |
||
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | */ |
||
59 | 1 | public function getPath() |
|
60 | { |
||
61 | 1 | return $this->path; |
|
62 | } |
||
63 | |||
64 | /** |
||
65 | * @return string |
||
66 | */ |
||
67 | 1 | public function getPrefix() |
|
68 | { |
||
69 | 1 | return $this->prefix; |
|
70 | } |
||
71 | |||
72 | /** |
||
73 | * @param string $prefix |
||
74 | * |
||
75 | * @throws InvalidArgumentException |
||
76 | */ |
||
77 | 1 | public function setPrefix($prefix) |
|
80 | 1 | } |
|
81 | } |
||
82 |