Skip to content

Add support for requiring the usage of named arguments #14386

@stof

Description

@stof

Feature request

Providing BC for both positional and named arguments at once basically forbids removing any argument other than the last one.
phpstan (and psalm) already supports @no-named-arguments to support the case where a package wants to provide BC only for the positional signature to keep flexibility for maintenance. However, for some cases, using named arguments is more convenient for DX, and projects might want to cover named arguments with BC without covering positional usage. It would be great to have a @only-named-arguments tag to support such cases.

Applying both tags on a method should of course be considered an error. However, I suggest that a method level tag should be able to reverse a rule defined at class level (treating the class-level rule as a default)

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

No response

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