Skip to content

Commit 4a0d9cb

Browse files
herndlmondrejmirtes
authored andcommitted
Adapt for recent PHPStan
1 parent 231d3f7 commit 4a0d9cb

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

Diff for: composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
],
88
"require": {
99
"php": "^7.2 || ^8.0",
10-
"phpstan/phpstan": "^1.12.12"
10+
"phpstan/phpstan": "^1.12.23"
1111
},
1212
"conflict": {
1313
"doctrine/collections": "<1.0",

Diff for: src/Type/Doctrine/DBAL/RowCountMethodDynamicReturnTypeExtension.php

+2-7
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method
6666
}
6767

6868
$resultClass = $this->getResultClass($driver);
69-
if ($resultClass === null) {
70-
return null;
71-
}
7269

7370
if (!$this->reflectionProvider->hasClass($resultClass)) {
7471
return null;
@@ -87,9 +84,9 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method
8784

8885
/**
8986
* @param DriverDetector::* $driver
90-
* @return class-string<DriverResult>|null
87+
* @return class-string<DriverResult>
9188
*/
92-
private function getResultClass(string $driver): ?string
89+
private function getResultClass(string $driver): string
9390
{
9491
switch ($driver) {
9592
case DriverDetector::IBM_DB2:
@@ -111,8 +108,6 @@ private function getResultClass(string $driver): ?string
111108
case DriverDetector::SQLSRV:
112109
return 'Doctrine\DBAL\Driver\SQLSrv\Result';
113110
}
114-
115-
return null;
116111
}
117112

118113
}

0 commit comments

Comments
 (0)