webman-console依赖的symfony-console版本升级到7.0后导致的兼容性问题

邓靖

webman-console依赖的symfony-console是写的>=5.0, 我们安装依赖的时候拉取到了symfony-console的7.0版本, 目前看会有4个问题:

  1. execute()方法强制约束了返回值为: int
  2. addUsage()方法的时候, 如果没有setName(), 会报致命错误, Fatal error: Uncaught ErrorException: str_starts_with(): Passing null to parameter #2 ($needle) of type string is deprecated
  3. redis-queue组件里面MakeConsumerCommand.php的写法也会报错, Uncaught
    Symfony\Component\Console\Exception\LogicException: The command defined in "Webman\RedisQueue\Command\MakeConsumerCommand" cannot have an empty name
  4. 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
429 1 1
1个评论

掌柜

感谢分享,打包时遇到redis-queue问题,通过方法解决!

  • 暂无评论

邓靖

220
积分
0
获赞数
0
粉丝数
2022-06-24 加入
🔝