Skip to content

Apply RemoveNullArgOnNullDefaultParamRector after AddNameToNullArgumentRector has been applied if deadCode: true #9771

@u01jmg3

Description

@u01jmg3

Feature Request

RE: rectorphp/rector-src#8000 (comment)

It would be useful if RemoveNullArgOnNullDefaultParamRector could run after AddNameToNullArgumentRector, when the deadCode set is enabled.

Example

Currently, AddNameToNullArgumentRector transforms:

-$table->addRow(null, $styles['cant-split']);
+$table->addRow(height: null, style: $styles['cant-split']);

It would be beneficial if this could be further reduced (when deadCode is enabled) to:

-$table->addRow(height: null, style: $styles['cant-split']);
+$table->addRow(style: $styles['cant-split']);

(Reference: https://github.com/PHPOffice/PHPWord/blob/master/src/PhpWord/Element/Table.php#L67)


Note

This behaviour could potentially also apply to AddNameToBooleanArgumentRector, if a corresponding RemoveBooleanArgOnBooleanDefaultParamRector existed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions