File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 99/.zencoder
1010.env
1111.htaccess
12- .gitignore
1312.user.ini
1413composer.lock
1514tame
Original file line number Diff line number Diff line change @@ -84,6 +84,9 @@ public static function run()
8484 }
8585 }
8686
87+ // If there are no files, we'll display a warning message.
88+ self ::noMigrationFound ($ files , $ errorstatus , $ errorMessage );
89+
8790 return new Collection ([
8891 'status ' => $ errorstatus ,
8992 'message ' => implode ("\n" , $ errorMessage )
@@ -148,10 +151,30 @@ public function drop($force = false)
148151 }
149152 }
150153
154+ // If there are no files, we'll display a warning message.
155+ self ::noMigrationFound ($ files , $ errorstatus , $ errorMessage );
156+
151157 return new Collection ([
152158 'status ' => $ errorstatus ,
153159 'message ' => implode ("\n" , $ errorMessage )
154160 ]);
155161 }
162+
163+ /**
164+ * If migration folder is empty, we will show this message
165+ *
166+ * @param array $files
167+ * @param mixed $errorstatus
168+ * @param mixed $errorMessage
169+ * @return void
170+ */
171+ protected static function noMigrationFound ($ files , &$ errorstatus , &$ errorMessage )
172+ {
173+ // empty folders, means no migrations found
174+ if (empty ($ files )){
175+ $ errorstatus = Constant::STATUS_400 ;
176+ $ errorMessage [] = "No migration found " ;
177+ }
178+ }
156179
157180}
You can’t perform that action at this time.
0 commit comments