Skip to content

Automate removal of unused PHP use statements #310

@Soean

Description

@Soean

Describe your use case and the problem you are facing

Currently, the codebase contain unused PHP use statements, which can clutter the code and increase the maintenance burden. Manually identifying and removing these is inefficient and prone to human error.

To streamline our workflow and ensure consistency across all packages using wp-cli-tests, I propose automating the detection and removal of unused imports.

Describe the solution you'd like

Integrate the Slevomat Coding Standard with a specific focus on the UnusedUses rule. This is a battle-tested tool that works seamlessly with PHP_CodeSniffer.

Target Rule:
SlevomatCodingStandard.Namespaces.UnusedUses

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions