我在我的代码库上收到了这个警告,这是我的composer
Package zendframework/zend-eventmanager is abandoned, you should avoid using it. Use laminas/laminas-eventmanager instead.所以我需要升级Doctrine Migrations bundle,但我似乎不能升级它,我也找不到升级日志。首先我得到了关于Doctrine\DBAL\Migrations\AbstractMigration的错误,所以我把它们都替换成了Doctrine\Migrations\AbstractMigration。现在我得到了
Compile Error: Declaration of Application\Migrations\Version20170927104049::up(Doctrine\DBAL\Schema\Schema $schema) must be compatible with Doctrine\Migrations\AbstractMigration::up(Doctrine\DB
AL\Schema\Schema $schema): void我要的是CHANGELOG https://github.com/doctrine/DoctrineMigrationsBundle/issues/296
不过,如果能帮上忙我们会非常感激
发布于 2020-02-15 23:59:14
该错误提示您的函数与抽象函数不兼容,您是否忘记将返回类型添加到您的函数?
让它:
public function up(Schema $schema) : void {}
发布于 2020-02-16 06:19:08
您应该首先通过composer upgrade升级您的包-例如,在您的composer.lock中,您在该捆绑包的近三年版本中使用ocramius/proxy-manager,而这需要废弃的包。2019年,zendframework/zend-eventmanager更名为laminas/laminas-eventmanager。
下一步可能是升级约束,以便您需要更新的包。例如,有更新版本的doctrine/doctrine-migrations-bundle或symfony/swiftmailer-bundle,不时地更新它们有助于避免出现问题。随着安装的版本与更新版本之间的差距越来越大,升级过程也变得越来越复杂。
另一方面:如果您的代码仍然正常工作,您可以简单地忽略该警告。它会告诉您给定的包终究不会收到任何更新,但这并不意味着您马上就处于危险之中
https://stackoverflow.com/questions/60239842
复制相似问题