@@ -9,71 +9,71 @@ |
||
9 | 9 | class Migrator extends M |
10 | 10 | { |
11 | 11 | |
12 | - /** |
|
13 | - * Get all of the migration files in a given path. |
|
14 | - * |
|
15 | - * @param string $path |
|
16 | - * @param bool $recursive |
|
17 | - * |
|
18 | - * @return array |
|
19 | - */ |
|
20 | - public function getMigrationFiles($paths = [], $recursive = true) |
|
21 | - { |
|
22 | - if ($recursive) { |
|
23 | - $paths = $this->getRecursiveFolders($paths); |
|
24 | - } |
|
12 | + /** |
|
13 | + * Get all of the migration files in a given path. |
|
14 | + * |
|
15 | + * @param string $path |
|
16 | + * @param bool $recursive |
|
17 | + * |
|
18 | + * @return array |
|
19 | + */ |
|
20 | + public function getMigrationFiles($paths = [], $recursive = true) |
|
21 | + { |
|
22 | + if ($recursive) { |
|
23 | + $paths = $this->getRecursiveFolders($paths); |
|
24 | + } |
|
25 | 25 | |
26 | - $files = parent::getMigrationFiles($paths); |
|
26 | + $files = parent::getMigrationFiles($paths); |
|
27 | 27 | |
28 | - return $files; |
|
29 | - } |
|
28 | + return $files; |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * Get all subdirectories located in an array of folders |
|
33 | - * |
|
34 | - * @param array $folders |
|
35 | - * |
|
36 | - * @return array |
|
37 | - */ |
|
38 | - public function getRecursiveFolders($folders) |
|
39 | - { |
|
40 | - if (! is_array($folders)) { |
|
41 | - $folders = [$folders]; |
|
42 | - } |
|
31 | + /** |
|
32 | + * Get all subdirectories located in an array of folders |
|
33 | + * |
|
34 | + * @param array $folders |
|
35 | + * |
|
36 | + * @return array |
|
37 | + */ |
|
38 | + public function getRecursiveFolders($folders) |
|
39 | + { |
|
40 | + if (! is_array($folders)) { |
|
41 | + $folders = [$folders]; |
|
42 | + } |
|
43 | 43 | |
44 | - $paths = []; |
|
44 | + $paths = []; |
|
45 | 45 | |
46 | - foreach ($folders as $folder) { |
|
47 | - $iter = new Iterator( |
|
48 | - new DirectoryIterator($folder, DirectoryIterator::SKIP_DOTS), |
|
49 | - Iterator::SELF_FIRST, |
|
50 | - Iterator::CATCH_GET_CHILD // Ignore "Permission denied" |
|
51 | - ); |
|
46 | + foreach ($folders as $folder) { |
|
47 | + $iter = new Iterator( |
|
48 | + new DirectoryIterator($folder, DirectoryIterator::SKIP_DOTS), |
|
49 | + Iterator::SELF_FIRST, |
|
50 | + Iterator::CATCH_GET_CHILD // Ignore "Permission denied" |
|
51 | + ); |
|
52 | 52 | |
53 | - $subPaths = array($folder); |
|
54 | - foreach ($iter as $path => $dir) { |
|
55 | - if ($dir->isDir()) { |
|
56 | - $subPaths[] = $path; |
|
57 | - } |
|
58 | - } |
|
53 | + $subPaths = array($folder); |
|
54 | + foreach ($iter as $path => $dir) { |
|
55 | + if ($dir->isDir()) { |
|
56 | + $subPaths[] = $path; |
|
57 | + } |
|
58 | + } |
|
59 | 59 | |
60 | - $paths = array_merge($paths, $subPaths); |
|
61 | - } |
|
60 | + $paths = array_merge($paths, $subPaths); |
|
61 | + } |
|
62 | 62 | |
63 | - return $paths; |
|
64 | - } |
|
63 | + return $paths; |
|
64 | + } |
|
65 | 65 | |
66 | - /** |
|
67 | - * Add date folders to migrations path. |
|
68 | - * |
|
69 | - * @param string $file |
|
70 | - * |
|
71 | - * @return string |
|
72 | - */ |
|
73 | - public function getDateFolderStructure($file) |
|
74 | - { |
|
75 | - $parts = explode('_', $file); |
|
66 | + /** |
|
67 | + * Add date folders to migrations path. |
|
68 | + * |
|
69 | + * @param string $file |
|
70 | + * |
|
71 | + * @return string |
|
72 | + */ |
|
73 | + public function getDateFolderStructure($file) |
|
74 | + { |
|
75 | + $parts = explode('_', $file); |
|
76 | 76 | |
77 | - return $parts[0].'/'.$parts[1].'/'; |
|
78 | - } |
|
77 | + return $parts[0].'/'.$parts[1].'/'; |
|
78 | + } |
|
79 | 79 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | public function getRecursiveFolders($folders) |
39 | 39 | { |
40 | - if (! is_array($folders)) { |
|
40 | + if ( ! is_array($folders)) { |
|
41 | 41 | $folders = [$folders]; |
42 | 42 | } |
43 | 43 |