Skip to content

list-like arrays should be lists #719

@Seldaek

Description

@Seldaek

I have this code in packagist (DownloadManager.php line 215):

        $versionIds = $this->getEM()->getConnection()->fetchFirstColumn(
            'SELECT id FROM package_version WHERE id IN (:ids)',
            ['ids' => array_keys($versionsWithDownloads)],
            ['ids' => ArrayParameterType::INTEGER]
        );
        \PHPStan\dumpType($versionIds);

which outputs:

Dumped type: array<int<0, max>, int<0, 4294967295>>

This was fine with phpstan 1.x but with 2.x it now complains about lists, so this started failing as I pass it into a list-requiring argument.

I believe it would be safe to convert these to lists, and I think it's phpstan-dba that is responsible for this and not phpstan-doctrine, but I hope I'm not bugging the wrong person :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions