Skip to content

[composer] Migrate refactor command to Symfony runtime #222

@coisa

Description

@coisa

Summary

Migrate the refactor command from the legacy Composer BaseCommand runtime to the new Symfony-command runtime proposed in #199.

This is one command-level subissue for the incremental Composer decoupling plan. It keeps the migration small enough to validate through both command entrypoints before moving to the next command.

Context

Parent issue: #199
Architecture discussion: #197

Current command class:

  • FastForward\DevTools\Console\Command\RefactorCommand

Migration Scope

  • Convert the real command implementation to extend Symfony\Component\Console\Command\Command instead of Composer\Command\BaseCommand.
  • Remove assumptions that depend on Composer IO or BaseCommand behavior from the real command.
  • Ensure the Composer capability exposes this command through the new ProxyCommand adapter once migrated.
  • Preserve the existing command name, aliases, description, help, arguments, options, output behavior, and exit codes.
  • Keep command-specific behavior in the real Symfony command or a handler, not in the Composer proxy.

Command-Specific Notes

Risk level: High

Runs Rector with local/packaged config fallback. Preserve alias behavior and fix semantics.

Acceptance Criteria

  • RefactorCommand no longer extends Composer\Command\BaseCommand.
  • The command is available through bin/dev-tools refactor --help.
  • The command is available through Composer plugin discovery in the composer-plugin-consumer fixture.
  • The Composer-facing command is a proxy when this command has been migrated.
  • Existing tests for RefactorCommand are updated to exercise the Symfony command runtime.
  • At least one regression verifies that the Composer proxy can execute or display help for refactor.
  • No user-facing option, argument, alias, or help text is intentionally removed.

Non-Goals

  • Do not extract this command into a separate package in this issue.
  • Do not build dev-tools-shim in this issue.
  • Do not migrate unrelated commands in this issue unless required by shared infrastructure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Released

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions