Total Complexity | 5 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Coverage | 76.92% |
Changes | 0 |
1 | <?php |
||
9 | trait HasPathsTrait |
||
10 | { |
||
11 | /** |
||
12 | * @param $path |
||
13 | */ |
||
14 | 1 | public function addBasePath($path) |
|
15 | { |
||
16 | 1 | $this->setPath($path . DIRECTORY_SEPARATOR . 'migrations', 'migrations'); |
|
17 | 1 | $this->setPath($path . DIRECTORY_SEPARATOR . 'seeds', 'seeds'); |
|
18 | 1 | } |
|
19 | |||
20 | /** |
||
21 | * @param $type |
||
22 | * @param $path |
||
23 | */ |
||
24 | 3 | public function setPath($path, $type = 'migrations') |
|
25 | { |
||
26 | 3 | $path = is_array($path) ? $path : [$path]; |
|
27 | 3 | $this->params['paths'][$type] = $path; |
|
|
|||
28 | 3 | } |
|
29 | |||
30 | /** |
||
31 | * Register a custom migration path. |
||
32 | * |
||
33 | * @param string $path |
||
34 | * @param string $type |
||
35 | * @return void |
||
36 | */ |
||
37 | public function path($path, $type = 'migrations') |
||
38 | { |
||
39 | $this->params['paths'][$type] = array_unique(array_merge($this->params['paths'][$type], [$path])); |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * @param string $type |
||
44 | * @return mixed |
||
45 | */ |
||
46 | 1 | public function paths($type = 'migrations') |
|
49 | } |
||
50 | } |