webman-console依赖的symfony-console版本升级到7.0后导致的兼容性问题
webman-console依赖的symfony-console是写的>=5.0, 我们安装依赖的时候拉取到了symfony-console的7.0版本, 目前看会有4个问题:
- execute()方法强制约束了返回值为: int
- addUsage()方法的时候, 如果没有setName(), 会报致命错误, Fatal error: Uncaught ErrorException: str_starts_with(): Passing null to parameter #2 ($needle) of type string is deprecated
- redis-queue组件里面MakeConsumerCommand.php的写法也会报错, Uncaught
Symfony\Component\Console\Exception\LogicException: The command defined in "Webman\RedisQueue\Command\MakeConsumerCommand" cannot have an empty name
- Fatal error: Declaration of Webman\Event\EventListCommand::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
以上都需要通过升级webman对应组件到最新版本来兼容
composer update webman/console webman/redis-queue webman/event
个评论
年代过于久远,无法发表评论
感谢分享,打包时遇到redis-queue问题,通过方法解决!