diff --git a/src/Extensions/MysqliQueryDynamicReturnTypeExtension.php b/src/Extensions/MysqliQueryDynamicReturnTypeExtension.php index a9a058a7f..1b1718b6a 100644 --- a/src/Extensions/MysqliQueryDynamicReturnTypeExtension.php +++ b/src/Extensions/MysqliQueryDynamicReturnTypeExtension.php @@ -129,7 +129,7 @@ private function inferResultType(Expr $queryExpr, Scope $scope): ?Type return null; } - $resultObjectType = new MysqliResultObjectType(\mysqli_result::class); + $resultObjectType = new MysqliResultObjectType(\mysqli_result::class); $resultObjectType->setRowType($resultType); $objects[] = $resultObjectType; diff --git a/src/MysqliReflection/MysqliResultObjectType.php b/src/MysqliReflection/MysqliResultObjectType.php index fa198ee62..533a04baa 100644 --- a/src/MysqliReflection/MysqliResultObjectType.php +++ b/src/MysqliReflection/MysqliResultObjectType.php @@ -4,7 +4,6 @@ namespace staabm\PHPStanDba\MysqliReflection; -use PHPStan\ShouldNotHappenException; use PHPStan\Type\ObjectType; use PHPStan\Type\Type; @@ -12,13 +11,14 @@ final class MysqliResultObjectType extends ObjectType { private ?Type $rowType; - public function setRowType(Type $rowType): void { + public function setRowType(Type $rowType): void + { $this->rowType = $rowType; } public function getIterableValueType(): \PHPStan\Type\Type { - if($this->rowType !== null) { + if ($this->rowType !== null) { return $this->rowType; }