diff --git a/composer.json b/composer.json index 8bd0d8f0..5c9b02bb 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ ], "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.12.12" + "phpstan/phpstan": "^1.12.23" }, "conflict": { "doctrine/collections": "<1.0", diff --git a/src/Type/Doctrine/DBAL/RowCountMethodDynamicReturnTypeExtension.php b/src/Type/Doctrine/DBAL/RowCountMethodDynamicReturnTypeExtension.php index 8fe17348..c754a41b 100644 --- a/src/Type/Doctrine/DBAL/RowCountMethodDynamicReturnTypeExtension.php +++ b/src/Type/Doctrine/DBAL/RowCountMethodDynamicReturnTypeExtension.php @@ -66,9 +66,6 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method } $resultClass = $this->getResultClass($driver); - if ($resultClass === null) { - return null; - } if (!$this->reflectionProvider->hasClass($resultClass)) { return null; @@ -87,9 +84,9 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method /** * @param DriverDetector::* $driver - * @return class-string|null + * @return class-string */ - private function getResultClass(string $driver): ?string + private function getResultClass(string $driver): string { switch ($driver) { case DriverDetector::IBM_DB2: @@ -111,8 +108,6 @@ private function getResultClass(string $driver): ?string case DriverDetector::SQLSRV: return 'Doctrine\DBAL\Driver\SQLSrv\Result'; } - - return null; } }