Refactor WPFunctions to be injectable with DI
This commit is contained in:
@ -241,8 +241,11 @@ class Migration extends SimpleWorker {
|
||||
return true;
|
||||
}
|
||||
|
||||
static function getNextRunDate() {
|
||||
static function getNextRunDate($wp = null) {
|
||||
if(is_null($wp)) {
|
||||
$wp = new WPFunctions();
|
||||
}
|
||||
// run migration immediately
|
||||
return Carbon::createFromTimestamp(WPFunctions::currentTime('timestamp'));
|
||||
return Carbon::createFromTimestamp($wp->currentTime('timestamp'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user