如何解决外部包的作曲家包循环依赖关系



参见 Github 问题,这个问题的起源。

我的包是phpdocumentor/reflection-docblock的,它不是依赖项。


我正在尝试将phpdocumentor/reflection-docblock更新到较新的phpunit/phpunit依赖项,该依赖项开始使用我更新的软件包。

有新的循环依赖关系:

  • ((phpdocumentor/reflection-docblock包需要phpunit/phpunit
  • phpunit/phpunit需要phpspec/prophecy(自 phpunit/phpunit 4.5 起(
  • phpspec/prophecy需要此phpdocumentor/reflection-docblock((包

在抽象中:

  • A 需要 B
  • B 需要 C(新的!
  • C 需要 A

之前 - 作品

{
    "require-dev": {
        "phpunit/phpunit": "4.4"
    }
}

之后 - 坏了

{
    "require-dev": {
        "phpunit/phpunit": "4.5"
    }
}

当我运行时:

composer update

作曲家冲突输出

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - Installation request for phpdocumentor/reflection-docblock dev-phpunit -> satisfiable by phpdocumentor/reflection-docblock[dev-phpunit].
    - phpspec/prophecy v1.3.1 requires phpdocumentor/reflection-docblock ~2.0 -> satisfiable by phpdocumentor/reflection-docblock[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5].
    - phpunit/phpunit 4.5.0 requires phpspec/prophecy ~1.3.1 -> satisfiable by phpspec/prophecy[v1.3.1].
    - Can only install one of: phpdocumentor/reflection-docblock[2.0.0, dev-phpunit].
    - Can only install one of: phpdocumentor/reflection-docblock[2.0.1, dev-phpunit].
    - Can only install one of: phpdocumentor/reflection-docblock[2.0.2, dev-phpunit].
    - Can only install one of: phpdocumentor/reflection-docblock[2.0.3, dev-phpunit].
    - Can only install one of: phpdocumentor/reflection-docblock[2.0.4, dev-phpunit].
    - Can only install one of: phpdocumentor/reflection-docblock[2.0.5, dev-phpunit].
    - Installation request for phpunit/phpunit 4.5 -> satisfiable by phpunit/phpunit[4.5.0].

我试过:

  • minimum-stability: dev
  • 别名"phpunit/phpunit": "4.5 as 4.4"

有什么想法吗?

添加

"extra": {
    "branch-alias": {
        "dev-master": "4.x-dev"
    }
}

phpdocumentor/reflection-docblockcomposer.json.

这将允许您使用当前主节点作为满足要求的版本4.x

缺点是。继续使用版本时,您必须更新此部分。

相关内容

  • 没有找到相关文章

最新更新