Skip to content

Support no-seal-properties/no-seal-methods on classes to avoid emitting UndefinedMagicMethod  #2588

@TysonAndre

Description

@TysonAndre

Some use cases, such as test frameworks, may rely on supporting unknown magic methods, while still having a few of their own magic methods.

It'd be useful if those classes could indicate psalm shouldn't emit UndefinedMagicMethod for any of their use cases.

@psalm-no-seal-methods would be one way to do this. (or @no-seal-methods

https://github.com/ifwe/phockito/blob/bd1849468daf9539e052a3af9d11d981008397a8/Phockito.php#L617-L626 is one example of this - it supports both of the following syntaxes for the returned value of Phockito::when(...) (return() has a known type, someMethod() doesn't).

Phockito::when($mockObj)->someMethod()->return($value);
Phockito::when($mockObj->someMethod())->return($value);

Metadata

Metadata

Assignees

No one assigned

    Labels

    easy problemsIssues that can be fixed without background knowledge of Psalm

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions