Skip to content

Commit f52b39c

Browse files
committed
fix
1 parent 5fbff4e commit f52b39c

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ parameters:
2828
count: 1
2929
path: src/Extensions/PdoStatementFetchDynamicReturnTypeExtension.php
3030

31-
-
32-
message: "#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantArrayType is error\\-prone and deprecated\\. Use Type\\:\\:getConstantArrays\\(\\) instead\\.$#"
33-
count: 1
34-
path: src/PdoReflection/PdoStatementObjectType.php
35-
3631
-
3732
message: "#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantArrayType is error\\-prone and deprecated\\. Use Type\\:\\:getConstantArrays\\(\\) instead\\.$#"
3833
count: 1

src/PdoReflection/PdoStatementObjectType.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ public function newWithFetchType(int $fetchType): self
6262
*/
6363
private function reduceBothType(Type $bothType, int $fetchType): Type
6464
{
65-
if (! $bothType instanceof ConstantArrayType) {
65+
$arrays = $bothType->getConstantArrays();
66+
if (count($arrays) !== 1) {
6667
return $bothType;
6768
}
69+
$bothType = $arrays[0];
6870

6971
if (\count($bothType->getValueTypes()) <= 0) {
7072
return $bothType;

0 commit comments

Comments
 (0)