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

Fix PHP8.4 errors with symfony/console #205

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

mjauvin
Copy link
Member

@mjauvin mjauvin commented Feb 19, 2025

This resolves the issues we're having with PHP8.4

PHP8.4 support was added in symfony/console 6.4.x

related to wintercms/winter#1306

@mjauvin mjauvin added this to the 1.2.8 milestone Feb 19, 2025
@mjauvin mjauvin requested a review from LukeTowers February 19, 2025 14:56
@mjauvin mjauvin self-assigned this Feb 19, 2025
@mjauvin
Copy link
Member Author

mjauvin commented Feb 19, 2025

I don't think the tests failure have anything to do with this, as we've seen in the past.

@bennothommo any idea ?

@LukeTowers
Copy link
Member

@mjauvin they must have changed the interface in newer versions of symfony/console. We'll need to make a change to our implementation of that method and make sure that it can support the range of versions specified in composer.json or be more specific with our range of supported versions.

@mjauvin
Copy link
Member Author

mjauvin commented Feb 20, 2025

@mjauvin they must have changed the interface in newer versions of symfony/console. We'll need to make a change to our implementation of that method and make sure that it can support the range of versions specified in composer.json or be more specific with our range of supported versions.

Not sure what you mean.

@LukeTowers
Copy link
Member

The error in the tests is:

Error: Return type (void) of method Winter\Storm\Console\Command::handleSignal() should be compatible with return type (int|false) of method Symfony\Component\Console\Command\SignalableCommandInterface::handleSignal()
 ------ ------------------------------------------------------------------------------ 
  Line   Console/Traits/HandlesCleanup.php (in context of class                        
         Winter\Storm\Console\Command)                                                 
 ------ ------------------------------------------------------------------------------ 
  42     Return type (void) of method                                                  
         Winter\Storm\Console\Command::handleSignal() should be compatible             
         with return type (int|false) of method                                        
         Symfony\Component\Console\Command\SignalableCommandInterface::handleSignal()  
 ------ ------------------------------------------------------------------------------ 

This means that handleSignal() method interface has been changed in symfony in the latest versions. So in order to support the latest version of symfony console we need to update our implementation in the HandlesCleanup trait to match the symfony one. Then we need to make sure that the change won't affect our support for earlier versions of symfony console, and if it does, then we need to figure out a more specific version constraint so that we can continue supporting PHP 8.0 to 8.4 with Winter.

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

Successfully merging this pull request may close these issues.

2 participants