georgringer / news

TYPO3 Extension news
GNU General Public License v2.0
265 stars 355 forks source link

ProxyClassRebuildCommand is not symfony/* 7.0 compatible #2312

Closed sfroemkenjw closed 10 months ago

sfroemkenjw commented 10 months ago

Bug Report

Current Behavior I got following error:

Fatal error: Declaration of GeorgRinger\News\Command\ProxyClassRebuildCommand::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) must be compatible with Symfony\Component\Console\Command\Command::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int in /var/www/html/vendor/georgringer/news/Classes/Command/ProxyClassRebuildCommand.php on line 26

Expected behavior/output No error message

Environment

Possible Solution

oliverklee commented 10 months ago

In general, I'd recommend using explicit dependencies (e.g., on symfony/console) in the composer.json when the extension relies on components/packages instead of depending on transitive dependencies (which caused this problem).

andreaskienast commented 10 months ago

In general, I'd recommend using explicit dependencies (e.g., on symfony/console) [...].

This, and tools like Rector would've identified this beforehand. The offending change is known since Symfony 5.x (no offense, tho).