From 952c2a0caa79b3fdc513e8db668029004f3a0f35 Mon Sep 17 00:00:00 2001 From: Anthony Cooper Date: Wed, 26 Apr 2023 17:00:44 +0100 Subject: [PATCH] Fix deprecation errors for PHP 8.2 (#1270) --- src/Contracts/MetricsRepository.php | 4 ++-- src/Repositories/RedisMetricsRepository.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Contracts/MetricsRepository.php b/src/Contracts/MetricsRepository.php index 9117283b..c996a1b6 100644 --- a/src/Contracts/MetricsRepository.php +++ b/src/Contracts/MetricsRepository.php @@ -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); @@ -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); diff --git a/src/Repositories/RedisMetricsRepository.php b/src/Repositories/RedisMetricsRepository.php index c3abe54d..9fffe147 100644 --- a/src/Repositories/RedisMetricsRepository.php +++ b/src/Repositories/RedisMetricsRepository.php @@ -177,13 +177,13 @@ 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) ); } @@ -191,13 +191,13 @@ 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) { $this->connection()->eval(LuaScripts::updateMetrics(), 2, - 'queue:'.$queue, 'measured_queues', str_replace(',', '.', $runtime) + 'queue:'.$queue, 'measured_queues', str_replace(',', '.', (string) $runtime) ); }