Fix Carbon-related problems reported by PHPStan

[MAILPOET-2560]
This commit is contained in:
Jan Jakeš
2019-12-12 17:01:02 +01:00
committed by Jack Kitterhing
parent cd01d5a948
commit 07fc94f046
3 changed files with 3 additions and 13 deletions

View File

@@ -250,9 +250,9 @@ class Scheduler {
$bounce_tasks = ScheduledTask::findFutureScheduledByType(Bounce::TASK_TYPE);
if (count($bounce_tasks)) {
$bounce_task = reset($bounce_tasks);
if (Carbon::createFromTimestamp(current_time('timestamp'))->addHour(42)->lessThan($bounce_task->scheduled_at)) {
if (Carbon::createFromTimestamp((int)current_time('timestamp'))->addHour(42)->lessThan($bounce_task->scheduled_at)) {
$random_offset = rand(-6 * 60 * 60, 6 * 60 * 60);
$bounce_task->scheduled_at = Carbon::createFromTimestamp(current_time('timestamp'))->addSecond((36 * 60 * 60) + $random_offset);
$bounce_task->scheduled_at = Carbon::createFromTimestamp((int)current_time('timestamp'))->addSecond((36 * 60 * 60) + $random_offset);
$bounce_task->save();
}
}