Skip to content

Return type (int) of method SomeClass::count() should be covariant with return type (int<0, max>) of method Countable::count() #3997

@snapshotpl

Description

@snapshotpl

Bug report

After update to 0.12.51 all my classes with implemented Countable report issue:

Return type (int) of method SomeClass::count() should be covariant with return type (int<0, max>) of method Countable::count()

It appear when strict mode it's enabled.

Code snippet that reproduces the problem

https://phpstan.org/r/02ca7893-6eb0-4318-9e74-5a6a0e0d5d2f

Expected output

No error or idea how to resolve this.

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