From 00b528791f9b5b488e42fa6d29f1513a3816eb1a Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Wed, 2 Jul 2025 10:07:22 -0400 Subject: [PATCH 1/2] Fix error with uncountable total_qs --- collectors/db_queries.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collectors/db_queries.php b/collectors/db_queries.php index 25100129..2bb53059 100644 --- a/collectors/db_queries.php +++ b/collectors/db_queries.php @@ -236,7 +236,7 @@ public function process_db_object() { 'is_main_query' => true, ) ); - $this->data->total_qs = count( $this->data->rows ); + $this->data->total_qs = is_countable( $this->data->rows ) ? count( $this->data->rows ) : 0; $this->data->total_time = $total_time; $this->data->has_result = $has_result; $this->data->has_trace = $has_trace; From 6f146e182e0957482bc10e12ffe867bdabb19f52 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Wed, 2 Jul 2025 10:09:57 -0400 Subject: [PATCH 2/2] Ignore phpstan error --- collectors/db_queries.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collectors/db_queries.php b/collectors/db_queries.php index 2bb53059..e30b6238 100644 --- a/collectors/db_queries.php +++ b/collectors/db_queries.php @@ -236,7 +236,7 @@ public function process_db_object() { 'is_main_query' => true, ) ); - $this->data->total_qs = is_countable( $this->data->rows ) ? count( $this->data->rows ) : 0; + $this->data->total_qs = is_countable( $this->data->rows ) ? count( $this->data->rows ) : 0; // @phpstan-ignore-line ternary.elseUnreachable $this->data->total_time = $total_time; $this->data->has_result = $has_result; $this->data->has_trace = $has_trace;