Skip to content

Consider re-enabling UnusedUseStatement and UnsortedUseStatements PHPCS rules #637

@alistair3149

Description

@alistair3149

Re-enable two PHPCS rules that are currently excluded in phpcs.xml:

  • MediaWiki.Classes.UnusedUseStatement.UnusedUse
  • MediaWiki.Classes.UnsortedUseStatements.UnsortedUse

UnusedUseStatement: Nothing in the toolchain currently catches unused use imports — PHPStan doesn't check this at any level, and Psalm's findUnusedCode doesn't cover it either. Re-enabling this rule closes that gap.

UnsortedUseStatements: Enforcing a consistent import order improves scannability and reduces merge conflicts in import blocks. The one-time churn of sorting existing files is minimal.

Result of exploratory discussion with @alistair3149.
Context: NeoWiki PHPCS, PHPStan, and Psalm configurations.
Written by Claude Code, Opus 4.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions