diff --git a/composer.json b/composer.json index b959569..3b61fb3 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "nette/neon": "~3.0", "nextras/multi-query-parser": "1.0.0", "phpstan/extension-installer": "1.3.1", - "phpstan/phpstan": "1.10.32", + "phpstan/phpstan": "1.10.38", "phpstan/phpstan-deprecation-rules": "1.1.4", "phpstan/phpstan-strict-rules": "1.5.1", "symfony/config": "~4.4 || ~5.0", diff --git a/src/Bridges/NetteDI/DbalExtension.php b/src/Bridges/NetteDI/DbalExtension.php index 815e7db..1cf7d9d 100644 --- a/src/Bridges/NetteDI/DbalExtension.php +++ b/src/Bridges/NetteDI/DbalExtension.php @@ -40,7 +40,7 @@ protected function setupConnection(array $config): void if (isset($config['debugger'])) { $debugger = (bool) $config['debugger']; } else { - $debugger = class_exists(\Tracy\Debugger::class, false) && Debugger::$productionMode === Debugger::DEVELOPMENT; + $debugger = class_exists(\Tracy\Debugger::class, false) && Debugger::$productionMode === false; // false === Debugger::Development } if ($debugger) { diff --git a/src/Drivers/Mysqli/MysqliDriver.php b/src/Drivers/Mysqli/MysqliDriver.php index 1d9a0ec..0345006 100644 --- a/src/Drivers/Mysqli/MysqliDriver.php +++ b/src/Drivers/Mysqli/MysqliDriver.php @@ -172,7 +172,7 @@ public function getAffectedRows(): int $this->checkConnection(); assert($this->connection !== null); $affectedRows = $this->connection->affected_rows; - if (is_string($affectedRows)) { // @phpstan-ignore-line + if (is_string($affectedRows)) { // Integer overflow, read the real value via IConnection::getDriver()::getResourceHandle()->affected_rows return -2; } diff --git a/src/Drivers/Mysqli/MysqliResultAdapter.php b/src/Drivers/Mysqli/MysqliResultAdapter.php index c2a5c65..ef32373 100644 --- a/src/Drivers/Mysqli/MysqliResultAdapter.php +++ b/src/Drivers/Mysqli/MysqliResultAdapter.php @@ -77,9 +77,8 @@ public function getTypes(): array public function getRowsCount(): int { - /** @phpstan-var int<0, max>|string $rows */ $rows = $this->result->num_rows; - if (is_string($rows)) { // @phpstan-ignore-line + if (is_string($rows)) { throw new InvalidStateException("Query returned more rows that Integer can store."); } return $rows;