Skip to content

return type altered from list<> to array{} #232

@greg0ire

Description

@greg0ire

While working on this upgrade, I got an error that does not make sense to me

328 Call to static method PHPUnit\Framework\Assert::assertCount() with 0
and array{array<string, mixed>} will always evaluate to false.
🪪 staticMethod.impossibleType
💡 Because the type is coming from a PHPDoc, you can turn off this
check by setting treatPhpDocTypesAsCertain: false in your
phpstan.neon.dist.

Without this extension, PHPStan seems to work just fine in that it doesn't do this change to the return type:

-list<array<string,mixed>>
+array{array<string, mixed>}

I'm reported this here because this change happens as soon as I enable this extension in the config:

    - vendor/phpstan/phpstan-phpunit/extension.neon

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions