forked from phpstan/phpstan-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbug-5509.php
More file actions
29 lines (22 loc) · 726 Bytes
/
Copy pathbug-5509.php
File metadata and controls
29 lines (22 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php // lint >= 8.0
namespace Bug5509;
class Foo
{
public function test(\PDOStatement $stmt): void
{
// FETCH_CLASS with class name and constructor args - should not error
$stmt->fetchAll(\PDO::FETCH_CLASS, \stdClass::class, [new \stdClass]);
// FETCH_CLASS with just class name - should not error
$stmt->fetchAll(\PDO::FETCH_CLASS, \stdClass::class);
// FETCH_COLUMN with column number - should not error
$stmt->fetchAll(\PDO::FETCH_COLUMN, 0);
// FETCH_FUNC with callable - should not error
$stmt->fetchAll(\PDO::FETCH_FUNC, function () {
return 'test';
});
// No args - should not error
$stmt->fetchAll();
// With just mode - should not error
$stmt->fetchAll(\PDO::FETCH_ASSOC);
}
}