Skip to content

Missing public API to detect if Scope is in a property hook #13393

@janedbal

Description

@janedbal

Feature request

The Scope::getFunction() method returns a PhpFunctionFromParserNodeReflection, which does not expose any methods to identify it as a property hook. The relevant methods exist only on the concrete PhpMethodFromParserNodeReflection class.

This forces developers to use instanceof PhpMethodFromParserNodeReflection to access the functionality. However, this is explicitly discouraged by the phpstanApi.instanceofAssumption rule.

Did PHPStan help you today? Did it make you happy in any way?

No response

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