Skip to content

Decouple WorkerCommandLineFactory from symfony/console#9

Merged
TomasVotruba merged 1 commit into
mainfrom
tv-decouple-symfony-console
Jun 19, 2026
Merged

Decouple WorkerCommandLineFactory from symfony/console#9
TomasVotruba merged 1 commit into
mainfrom
tv-decouple-symfony-console

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Why

WorkerCommandLineFactory reflected over a Symfony\Component\Console\Command to mirror its options onto the worker sub-process command line. That hard-wired symfony/console into the package, blocking consumers that run on a different console layer.

What

  • Rewrite WorkerCommandLineFactory::create() to a plain-data signature: worker command name, scalar option values, paths, identifier, port. The worker command name is emitted as the first token, so the command line is deterministic and does not depend on a Symfony Command instance.
  • Delete CommandFromReflectionFactory (only used by the factory).
  • Remove symfony/console from require.
  • Update WorkerCommandLineFactoryTest, drop the Symfony command fixtures (MainCommand, SomeService).

Breaking change

create() signature changed (no longer accepts a Command object). Major version bump.

Verified

  • phpunit — 2 tests green
  • phpstan — no errors

WorkerCommandLineFactory no longer reflects over a Symfony Console
Command to build the worker command line. It now takes plain data
(worker command name, scalar option values, paths) and assembles a
deterministic command line with the worker command name as the first
token.

This drops the symfony/console requirement entirely, letting consumers
run on any console layer.

- rewrite WorkerCommandLineFactory::create() to a plain-data signature
- delete CommandFromReflectionFactory (only used by the factory)
- remove symfony/console from require
- update tests, drop Symfony command fixtures
@TomasVotruba TomasVotruba merged commit 5051c93 into main Jun 19, 2026
6 checks passed
@TomasVotruba TomasVotruba deleted the tv-decouple-symfony-console branch June 19, 2026 22:39
@TomasVotruba

Copy link
Copy Markdown
Member Author

This will require major version bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant