Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions stubs/PDOStatement.stub
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@ class PDOStatement implements Traversable, IteratorAggregate
* @return array{name: string, table?: string, native_type?: string, len: int, flags: array<int, string>, precision: int<0, max>, pdo_type: PDO::PARAM_* }|false
*/
public function getColumnMeta(int $column) {}

/**
* @return Iterator
*/
public function getIterator() {}
}
13 changes: 13 additions & 0 deletions tests/PHPStan/Analyser/nsrt/bug-8886.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php // lint >= 8.0

namespace Bug8886;

use PDO;
use function PHPStan\Testing\assertType;

function testPDOStatementGetIterator(): void {
$pdo = new PDO('sqlite::memory:');
$stmt = $pdo->query('SELECT 1');

assertType('Iterator', $stmt->getIterator());
}
Loading