Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #174 from eivydas/fix/deprecation-warnings
Browse files Browse the repository at this point in the history
Fix deprecation notices for implicit conversion from float to int
  • Loading branch information
roelvanduijnhoven authored Apr 25, 2022
2 parents 631c07f + df1a50e commit 8c8ea8e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/Queue/DoctrineQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ public function push(JobInterface $job, array $options = []): void
{
$time = microtime(true);
$micro = sprintf("%06d", ($time - floor($time)) * 1000000);
$this->now = new DateTime(date('Y-m-d H:i:s.' . $micro, $time), new DateTimeZone(date_default_timezone_get()));
$this->now = new DateTime(
date('Y-m-d H:i:s.' . $micro, (int)$time),
new DateTimeZone(date_default_timezone_get())
);
$scheduled = $this->parseOptionsToDateTime($options);

$this->connection->insert($this->options->getTableName(), [
Expand Down Expand Up @@ -116,7 +119,7 @@ public function pop(array $options = []): ?JobInterface
$time = microtime(true);
$micro = sprintf("%06d", ($time - floor($time)) * 1000000);
$this->now = new DateTime(
date('Y-m-d H:i:s.' . $micro, $time),
date('Y-m-d H:i:s.' . $micro, (int)$time),
new DateTimeZone(date_default_timezone_get())
);

Expand Down Expand Up @@ -201,7 +204,7 @@ public function delete(JobInterface $job, array $options = []): void
$time = microtime(true);
$micro = sprintf("%06d", ($time - floor($time)) * 1000000);
$this->now = new DateTime(
date('Y-m-d H:i:s.' . $micro, $time),
date('Y-m-d H:i:s.' . $micro, (int)$time),
new DateTimeZone(date_default_timezone_get())
);

Expand Down Expand Up @@ -242,7 +245,7 @@ public function bury(JobInterface $job, array $options = []): void
$time = microtime(true);
$micro = sprintf("%06d", ($time - floor($time)) * 1000000);
$this->now = new DateTime(
date('Y-m-d H:i:s.' . $micro, $time),
date('Y-m-d H:i:s.' . $micro, (int)$time),
new DateTimeZone(date_default_timezone_get())
);

Expand Down Expand Up @@ -360,7 +363,10 @@ protected function parseOptionsToDateTime(array $options): DateTime
{
$time = microtime(true);
$micro = sprintf("%06d", ($time - floor($time)) * 1000000);
$this->now = new DateTime(date('Y-m-d H:i:s.' . $micro, $time), new DateTimeZone(date_default_timezone_get()));
$this->now = new DateTime(
date('Y-m-d H:i:s.' . $micro, (int)$time),
new DateTimeZone(date_default_timezone_get())
);
$scheduled = clone ($this->now);

if (isset($options['scheduled'])) {
Expand Down

0 comments on commit 8c8ea8e

Please sign in to comment.