Skip to content

Add rector to convert assigns to named arguments #9302

@calebdw

Description

@calebdw

Feature Request

Hello!

We have a bunch of legacy code that uses assignments to indicate the parameter name (the created variable is not used in the rest of the scope). For PHP 8+, this can be converted to using named arguments.

If such a rector does not yet exist then I will start working on one if this is desired.

Diff

-in_array('foo', $array, $strict = true);
+in_array('foo', $array, strict: true);

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions