Refactor WPFunctions to be injectable with DI

This commit is contained in:
Amine Ben hammou
2018-12-12 14:41:44 +01:00
parent e059ee7364
commit a46d98ec44
23 changed files with 146 additions and 97 deletions

View File

@ -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'));
}
}