From 38b725c88c4c4a1f35ba3599d5e743597009bbdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Wawrzyniak?= Date: Tue, 12 May 2026 16:23:00 +0200 Subject: [PATCH] Make the explicit nullable type for PHP 8.4 compatibility --- src/DB/DB.php | 4 ++-- src/DB/Database/Exceptions/DatabaseQueryException.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DB/DB.php b/src/DB/DB.php index b032ba2..d122a9d 100644 --- a/src/DB/DB.php +++ b/src/DB/DB.php @@ -460,7 +460,7 @@ private static function run_batched_query( string $query, int $batch_size, Closu * * @return Generator A generator to get all the results of the query. */ - public static function generate_results( string $query = null, string $output = OBJECT, int $batch_size = 20 ): Generator { + public static function generate_results( ?string $query = null, string $output = OBJECT, int $batch_size = 20 ): Generator { yield from self::run_batched_query( $query, $batch_size, static function ( string $run_query ) use ( $output ) { return self::get_results( $run_query, $output ); } ); @@ -477,7 +477,7 @@ public static function generate_results( string $query = null, string $output = * * @return Generator The values of the column. */ - public function generate_col( string $query = null, int $x = 0, int $batch_size = 50 ): Generator { + public function generate_col( ?string $query = null, int $x = 0, int $batch_size = 50 ): Generator { yield from self::run_batched_query( $query, $batch_size, static function ( string $run_query ) use ( $x ) { return self::get_col( $run_query, $x ); } ); diff --git a/src/DB/Database/Exceptions/DatabaseQueryException.php b/src/DB/Database/Exceptions/DatabaseQueryException.php index 69abf21..ca51e9b 100644 --- a/src/DB/Database/Exceptions/DatabaseQueryException.php +++ b/src/DB/Database/Exceptions/DatabaseQueryException.php @@ -33,7 +33,7 @@ public function __construct( array $queryErrors, string $message = 'Database Query', $code = 0, - Throwable $previous = null + ?Throwable $previous = null ) { $this->query = $query; $this->queryErrors = $queryErrors;