Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hard requirement on symfony/console 5 #63

Open
paul-m opened this issue Jul 7, 2024 · 2 comments
Open

Hard requirement on symfony/console 5 #63

paul-m opened this issue Jul 7, 2024 · 2 comments

Comments

@paul-m
Copy link

paul-m commented Jul 7, 2024

I'm installing progpilot as a Composer-based dev dependency.

I'm trying to use it with a Drupal module codebase, experimentally, to try and evaluate progpilot. Drupal uses Symfony 6.

I can require progpilot, but I get this error when I run it:

$ ./vendor/bin/progpilot ./
PHP Fatal error:  Declaration of progpilot\Console\Application::run(?Symfony\Component\Console\Input\InputInterface $input = null, ?Symfony\Component\Console\Output\OutputInterface $output = null) must be compatible with Symfony\Component\Console\Application::run(?Symfony\Component\Console\Input\InputInterface $input = null, ?Symfony\Component\Console\Output\OutputInterface $output = null): int in /var/www/html/vendor/designsecurity/progpilot/package/src/progpilot/Console/Application.php on line 27

This is because progpilot constrains it's symfony/console version to ^5.4.17, which allows for it to be used with Symfony 6, even though the signature for run() is incompatible.

I'd suggest changing the constraint to ^5.4 or otherwise tighten the constraint to disallow Symfony 6.

I'm also a little mystified how the CI doesn't fail due to this issue, since Composer should update symfony/console to 6+.

My workaround is to install globally with Composer: composer global require designsecurity/progpilot

Note that this still throws a lot of deprecation errors under PHP 8.3.

To repro:

composer create-project "drupal/recommended-project:@stable"
cd recommended-project
composer require --dev designsecurity/progpilot
./vendor/bin/progpilot ./

We installed Drupal 10.3.1:

composer show drupal/core | grep versions
versions : * 10.3.1

This gives us:

PHP Fatal error:  Declaration of progpilot\Console\Application::run(?Symfony\Component\Console\Input\InputInterface $input = null, ?Symfony\Component\Console\Output\OutputInterface $output = null) must be compatible with Symfony\Component\Console\Application::run(?Symfony\Component\Console\Input\InputInterface $input = null, ?Symfony\Component\Console\Output\OutputInterface $output = null): int in /Users/paul/test/recommended-project/vendor/designsecurity/progpilot/package/src/progpilot/Console/Application.php on line 27
@paul-m paul-m changed the title progpilot Hard requirement on symfony/console 5 Jul 10, 2024
@eric-therond
Copy link
Collaborator

Hello
can you provide a small reproducer of your composer.json?

Note that this still throws a lot of deprecation errors under PHP 8.3.

Same thing, I tested with PHP 8.1 and didn't see depreciation errors.

Thanks

@paul-m
Copy link
Author

paul-m commented Jul 30, 2024

One would expect that running it under PHP 8.1 would not throw the same deprecation errors as PHP 8.3...

I'll put better repro steps in the OP.

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

No branches or pull requests

2 participants