Total Complexity | 6 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Coverage | 93.75% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | trait HasPathsTrait |
||
14 | { |
||
15 | /** |
||
16 | * @return string |
||
17 | */ |
||
18 | public function getBasePath() |
||
19 | 11 | { |
|
20 | if (null === $this->getDirectory()) { |
||
|
|||
21 | 11 | $this->initBasePath(); |
|
22 | 11 | } |
|
23 | |||
24 | return $this->getDirectory(); |
||
25 | 11 | } |
|
26 | |||
27 | /** |
||
28 | * @param string $path |
||
29 | * |
||
30 | * @return $this |
||
31 | * |
||
32 | 11 | * @deprecated use Set |
|
33 | */ |
||
34 | 11 | public function setBasePath($path) |
|
35 | 11 | { |
|
36 | 11 | $path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
|
37 | 11 | $this->setDirectory($path); |
|
38 | $this->getResolveTemplatePath()->prependPath($path); |
||
39 | |||
40 | return $this; |
||
41 | } |
||
42 | |||
43 | abstract public function getFinder(); |
||
44 | |||
45 | 11 | protected function initBasePath() |
|
48 | 11 | } |
|
49 | |||
50 | /** |
||
51 | * @return string|bool |
||
52 | */ |
||
53 | 11 | protected function generateBasePath() |
|
60 | } |
||
61 | } |
||
62 |