| Total Complexity | 6 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Coverage | 93.75% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | trait HasPathsTrait |
||
| 10 | { |
||
| 11 | protected $basePath = null; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @return string |
||
| 15 | */ |
||
| 16 | 6 | public function getBasePath() |
|
| 17 | { |
||
| 18 | 6 | if ($this->basePath === null) { |
|
| 19 | 6 | $this->initBasePath(); |
|
| 20 | } |
||
| 21 | |||
| 22 | 6 | return $this->basePath; |
|
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param string $path |
||
| 27 | * @return $this |
||
| 28 | */ |
||
| 29 | 6 | public function setBasePath($path) |
|
| 30 | { |
||
| 31 | 6 | $path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
|
| 32 | 6 | $this->basePath = $path; |
|
| 33 | 6 | $this->getFinder()->setPaths($path); |
|
|
|
|||
| 34 | 6 | return $this; |
|
| 35 | } |
||
| 36 | |||
| 37 | 6 | protected function initBasePath() |
|
| 40 | 6 | } |
|
| 41 | |||
| 42 | /** |
||
| 43 | * @return string |
||
| 44 | */ |
||
| 45 | 6 | protected function generateBasePath() |
|
| 52 | } |
||
| 53 | } |
||
| 54 |