Skip to content

Add type detection for PDOStatement::fetchAll(PDO::FETCH_CLASS, SomeClass::class) #9974

@thomas-0816

Description

@thomas-0816

Example fetchAll: https://psalm.dev/r/a9b0c85b47

Add type detection for PDOStatement::fetchAll(PDO::FETCH_CLASS, SomeClass::class): SomeClass[]|false;

Currently PDOStatement::fetchAll() is currently defined as:

'PDOStatement::fetchAll' => ['array', 'mode='=>'int', '...args='=>'mixed'],

which infers to array<array-key, mixed> instead of array<array-key, SomeClass>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions