Skip to content

False positive Dynamic call to static method when mixing in another class and implementing __call and __callStatic #298

@msbit

Description

@msbit

When you've a class Foo that:

  • provides implementations of both __call and __callStatic, and
  • mixes in another class Bar that has an instance method bar

creating an instance of Foo and calling that instance method results in an error of the form:

Dynamic call to static method Bar::bar(). [identifier=staticMethod.dynamicCall]

Playground: https://phpstan.org/r/bfd29cdb-749b-4b97-bd50-92ecb0fcfc92

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions