Skip to content

False positive: Separate functions with same name, but different signature. #4114

@josteinAtProresult

Description

@josteinAtProresult

Bug report

Phpstan does not seem to separate "symbols" (functions, class constructors at least) based on what files are actually in scope in the file being analyzed.

In a codebase where there is multiple files declaring a function of the same name, but different number of arguments, phpstan will incorrectly report an error like "Function XXX invoked with 1 parameter, 2 required.". See reproduction code to clarify.

Code snippet that reproduces the problem

Not possible to reproduce in one file on playground, but minimal reproduction example is published on github:

https://github.com/josteinAtProresult/phpstan-issue-reproduce1

Expected output

0 errors.

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