diff --git a/application/clicommands/ScheduleCommand.php b/application/clicommands/ScheduleCommand.php index f50d046..7e09792 100644 --- a/application/clicommands/ScheduleCommand.php +++ b/application/clicommands/ScheduleCommand.php @@ -18,7 +18,7 @@ use ipl\Scheduler\Contract\Task; use ipl\Scheduler\Scheduler; use React\EventLoop\Loop; -use React\Promise\ExtendedPromiseInterface; +use React\Promise\PromiseInterface; use Throwable; class ScheduleCommand extends Command @@ -121,7 +121,7 @@ protected function attachJobsLogging(Scheduler $scheduler) Logger::debug($e->getTraceAsString()); }); - $scheduler->on(Scheduler::ON_TASK_RUN, function (Task $job, ExtendedPromiseInterface $_) { + $scheduler->on(Scheduler::ON_TASK_RUN, function (Task $job, PromiseInterface $_) { Logger::info('Running job %s', $job->getName()); }); diff --git a/library/Reporting/Actions/SendMail.php b/library/Reporting/Actions/SendMail.php index 64f9d4b..6426543 100644 --- a/library/Reporting/Actions/SendMail.php +++ b/library/Reporting/Actions/SendMail.php @@ -55,7 +55,7 @@ function ($pdf) use ($mail, $name, $recipients) { $mail->attachPdf($pdf, $name); $mail->send(null, $recipients); } - )->otherwise(function (Throwable $e) { + )->catch(function (Throwable $e) { Logger::error($e); Logger::debug($e->getTraceAsString()); }); diff --git a/library/Reporting/Schedule.php b/library/Reporting/Schedule.php index ddd8bd3..55e0433 100644 --- a/library/Reporting/Schedule.php +++ b/library/Reporting/Schedule.php @@ -12,7 +12,7 @@ use Ramsey\Uuid\Uuid; use React\EventLoop\Loop; use React\Promise; -use React\Promise\ExtendedPromiseInterface; +use React\Promise\PromiseInterface; use function md5; @@ -128,7 +128,7 @@ public function getChecksum(): string ); } - public function run(): ExtendedPromiseInterface + public function run(): PromiseInterface { $deferred = new Promise\Deferred(); Loop::futureTick(function () use ($deferred) { @@ -144,12 +144,9 @@ public function run(): ExtendedPromiseInterface return; } - $deferred->resolve(); + $deferred->resolve(null); }); - /** @var ExtendedPromiseInterface $promise */ - $promise = $deferred->promise(); - - return $promise; + return $deferred->promise(); } }