diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 967bd1c..717b0c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: strategy: matrix: - php-version: [ '8.1', '8.2', '8.3' ] + php-version: [ '8.1', '8.2', '8.3', '8.4' ] steps: - name: Checkout @@ -58,7 +58,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: [ '8.1', '8.2', '8.3' ] + php-version: [ '8.1', '8.2', '8.3', '8.4' ] runs-on: ubuntu-latest diff --git a/composer.json b/composer.json index 052a33a..53d86e3 100644 --- a/composer.json +++ b/composer.json @@ -20,10 +20,10 @@ "nette/tester": "~2.4", "nette/caching": "~3.0", "nette/di": "~3.0", - "nette/utils": "~3.0", - "nette/finder": "~2.5", + "nette/utils": "~3.0 || ~4.0", + "nette/finder": "~2.5 || ~3.0", "nette/neon": "~3.0", - "nextras/multi-query-parser": "1.0.0", + "nextras/multi-query-parser": "~1.0", "phpstan/extension-installer": "1.4.3", "phpstan/phpstan": "1.12.7", "phpstan/phpstan-deprecation-rules": "1.2.1", diff --git a/src/Bridges/SymfonyBundle/DataCollector/QueryDataCollector.php b/src/Bridges/SymfonyBundle/DataCollector/QueryDataCollector.php index 06c56b3..efb774d 100644 --- a/src/Bridges/SymfonyBundle/DataCollector/QueryDataCollector.php +++ b/src/Bridges/SymfonyBundle/DataCollector/QueryDataCollector.php @@ -46,7 +46,7 @@ public function getName() } - public function collect(Request $request, Response $response, \Throwable $exception = null): void + public function collect(Request $request, Response $response, \Throwable|null $exception = null): void { foreach ($this->queries as [$sqlQuery, $timeTaken, $rowsCount]) { $row = [ diff --git a/src/Drivers/Exception/DriverException.php b/src/Drivers/Exception/DriverException.php index 1b91830..a6f8825 100644 --- a/src/Drivers/Exception/DriverException.php +++ b/src/Drivers/Exception/DriverException.php @@ -12,7 +12,7 @@ public function __construct( string $message, private readonly int $errorCode = 0, private readonly string $errorSqlState = '', - Exception $previousException = null + Exception|null $previousException = null ) { parent::__construct($message, 0, $previousException); diff --git a/src/Drivers/Exception/QueryException.php b/src/Drivers/Exception/QueryException.php index 5c98e17..953d87c 100644 --- a/src/Drivers/Exception/QueryException.php +++ b/src/Drivers/Exception/QueryException.php @@ -12,7 +12,7 @@ public function __construct( string $message, int $errorCode = 0, string $errorSqlState = '', - Exception $previousException = null, + Exception|null $previousException = null, private readonly ?string $sqlQuery = null ) { diff --git a/src/Drivers/Exception/UnknownMysqlTimezoneException.php b/src/Drivers/Exception/UnknownMysqlTimezoneException.php index 2ae8278..47eab91 100644 --- a/src/Drivers/Exception/UnknownMysqlTimezoneException.php +++ b/src/Drivers/Exception/UnknownMysqlTimezoneException.php @@ -12,7 +12,7 @@ public function __construct( string $message, int $errorCode = 0, string $errorSqlState = '', - Exception $previousException = null, + Exception|null $previousException = null, ?string $sqlQuery = null, ) { diff --git a/src/Drivers/Mysqli/MysqliDriver.php b/src/Drivers/Mysqli/MysqliDriver.php index b2eea6e..81054f2 100644 --- a/src/Drivers/Mysqli/MysqliDriver.php +++ b/src/Drivers/Mysqli/MysqliDriver.php @@ -209,8 +209,12 @@ public function getServerVersion(): string public function ping(): bool { $this->checkConnection(); - assert($this->connection !== null); - return $this->connection->ping(); + try { + $this->query('SELECT 1'); + return true; + } catch (DriverException) { + return false; + } } diff --git a/src/Drivers/Mysqli/MysqliResultNormalizerFactory.php b/src/Drivers/Mysqli/MysqliResultNormalizerFactory.php index 1de9f19..21863c2 100644 --- a/src/Drivers/Mysqli/MysqliResultNormalizerFactory.php +++ b/src/Drivers/Mysqli/MysqliResultNormalizerFactory.php @@ -76,7 +76,7 @@ public function resolve(array $types): array static $ints = [ MYSQLI_TYPE_BIT => true, MYSQLI_TYPE_INT24 => true, - MYSQLI_TYPE_INTERVAL => true, + MYSQLI_TYPE_ENUM => true, MYSQLI_TYPE_TINY => true, MYSQLI_TYPE_SHORT => true, MYSQLI_TYPE_LONG => true,