Skip to content

Commit

Permalink
Fix deprecation errors for PHP 8.2 (#1270)
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonCooper committed Apr 26, 2023
1 parent 8a52a44 commit 952c2a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Contracts/MetricsRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function queueWithMaximumThroughput();
* Increment the metrics information for a job.
*
* @param string $job
* @param float $runtime
* @param float|null $runtime
* @return void
*/
public function incrementJob($job, $runtime);
Expand All @@ -91,7 +91,7 @@ public function incrementJob($job, $runtime);
* Increment the metrics information for a queue.
*
* @param string $queue
* @param float $runtime
* @param float|null $runtime
* @return void
*/
public function incrementQueue($queue, $runtime);
Expand Down
8 changes: 4 additions & 4 deletions src/Repositories/RedisMetricsRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,27 +177,27 @@ public function queueWithMaximumThroughput()
* Increment the metrics information for a job.
*
* @param string $job
* @param float $runtime
* @param float|null $runtime
* @return void
*/
public function incrementJob($job, $runtime)
{
$this->connection()->eval(LuaScripts::updateMetrics(), 2,
'job:'.$job, 'measured_jobs', str_replace(',', '.', $runtime)
'job:'.$job, 'measured_jobs', str_replace(',', '.', (string) $runtime)
);
}

/**
* Increment the metrics information for a queue.
*
* @param string $queue
* @param float $runtime
* @param float|null $runtime
* @return void
*/
public function incrementQueue($queue, $runtime)
{
$this->connection()->eval(LuaScripts::updateMetrics(), 2,
'queue:'.$queue, 'measured_queues', str_replace(',', '.', $runtime)
'queue:'.$queue, 'measured_queues', str_replace(',', '.', (string) $runtime)
);
}

Expand Down

0 comments on commit 952c2a0

Please sign in to comment.