Skip to content

Fix #128: remove symfony/console dependency by adopting Entropy - #131

Merged
TomasVotruba merged 1 commit into
rectorphp:mainfrom
HecFranco:use-entropy-console
Jun 12, 2026
Merged

Fix #128: remove symfony/console dependency by adopting Entropy#131
TomasVotruba merged 1 commit into
rectorphp:mainfrom
HecFranco:use-entropy-console

Conversation

@HecFranco

Copy link
Copy Markdown
Contributor

Fixes #128

Summary

Resolves the Composer dependency conflict reported in #128 by removing the direct symfony/console requirement and adopting Entropy as the console layer.

Projects using Symfony 8 (e.g. symfony/yaml ^8.1) could not install rector/swiss-knife because the package required symfony/console ^6.4.24, which conflicts with Symfony 8 components. This PR fixes that root cause instead of widening the symfony/console constraint (see maintainer feedback on #129).

What changed

  • Remove symfony/console from composer.json
  • Bump entropy/entropy to ^0.4.0
  • Replace SymfonyStyle with Entropy\Console\Output\OutputPrinter in CLI commands and ClassConstantFetchFinder
  • Replace Symfony ProgressBar with Entropy\Console\Output\ProgressBar where needed
  • Remove manual SymfonyStyle registration from ContainerFactory

Test plan

  • composer validate
  • vendor/bin/phpunit
  • vendor/bin/phpstan analyse
  • vendor/bin/ecs check
  • vendor/bin/composer-dependency-analyser
  • bin/swiss-knife --help
  • No direct Symfony\Component\Console usage in src, tests, bin, config

Migrate CLI output from SymfonyStyle to OutputPrinter and ProgressBar, remove the direct symfony/console dependency, and bump entropy to ^0.4.0 to resolve dependency conflicts in Symfony 8 projects (fixes rectorphp#128).
@HecFranco

Copy link
Copy Markdown
Contributor Author

@TomasVotruba Ready for review.
This addresses #128: projects on Symfony 8 could not install rector/swiss-knife due to the symfony/console ^6.4.24 constraint. Instead of widening that constraint (#129), the package now uses Entropy (OutputPrinter, ProgressBar) and drops the direct symfony/console dependency.
Verified locally:

  • composer validate
  • vendor/bin/phpunit
  • vendor/bin/phpstan analyse
  • vendor/bin/ecs check
  • vendor/bin/composer-dependency-analyser
  • bin/swiss-knife --help
    If this looks good to you, I think it’s ready to merge. Thanks!

@TomasVotruba
TomasVotruba merged commit 961c90b into rectorphp:main Jun 12, 2026
8 checks passed
@TomasVotruba

Copy link
Copy Markdown
Member

Looks good💪

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add Symfony Console 7.4 support — symfony/console constraint blocks Symfony 7 projects

2 participants