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

@ -130,7 +130,7 @@ class ScheduledTask extends Model {
function rescheduleProgressively() {
$scheduled_at = Carbon::createFromTimestamp($this->wp->currentTime('timestamp'));
$timeout = min(self::BASIC_RESCHEDULE_TIMEOUT * pow(2, $this->reschedule_count), self::MAX_RESCHEDULE_TIMEOUT);
$timeout = (int)min(self::BASIC_RESCHEDULE_TIMEOUT * pow(2, $this->reschedule_count), self::MAX_RESCHEDULE_TIMEOUT);
$this->scheduled_at = $scheduled_at->addMinutes($timeout);
$this->reschedule_count++;
$this->status = ScheduledTask::STATUS_SCHEDULED;