Skip to content

Commit 4c8e1be

Browse files
committed
fix
1 parent 2904591 commit 4c8e1be

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ parameters:
1313
count: 1
1414
path: src/Extensions/DeployerRunMysqlQueryDynamicReturnTypeExtension.php
1515

16-
-
17-
message: "#^Cannot call method getConstantArrays\\(\\) on PHPStan\\\\Type\\\\Type\\|null\\.$#"
18-
count: 1
19-
path: src/Extensions/DeployerRunMysqlQueryDynamicReturnTypeExtension.php
20-
2116
-
2217
message: "#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantArrayType is error\\-prone and deprecated\\. Use Type\\:\\:getConstantArrays\\(\\) instead\\.$#"
2318
count: 2

src/Extensions/DeployerRunMysqlQueryDynamicReturnTypeExtension.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection,
4444
return null;
4545
}
4646

47-
$resultTypes = $queryReflection->getResultType($queryString, QueryReflector::FETCH_TYPE_NUMERIC)->getConstantArrays();
47+
$resultTypes = $queryReflection->getResultType($queryString, QueryReflector::FETCH_TYPE_NUMERIC);
48+
if (null === $resultTypes) {
49+
return null;
50+
}
51+
52+
$resultTypes = $resultTypes->getConstantArrays();
4853
if (count($resultTypes) === 1) {
4954
$resultType = $resultTypes[0];
5055

0 commit comments

Comments
 (0)