首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用composer安装phpdocumentor/反射

用composer安装phpdocumentor/反射
EN

Stack Overflow用户
提问于 2016-11-14 15:12:05
回答 2查看 3.6K关注 0票数 1

我想在我的SF2项目中安装phpdocumentor/reflexion包。因此,我运行以下命令composer require "phpdocumentor/reflection",但我有以下堆栈错误:

代码语言:javascript
复制
 Your requirements could not be resolved to an installable set of packages.

Problem 1

- Conclusion: don't install phpdocumentor/reflection 3.0.1
- Conclusion: remove phpdocumentor/reflection-docblock 3.1.1
- Installation request for phpdocumentor/reflection ^3.0 -> satisfiable by phpdocumentor/reflection[3.0.0, 3.0.1].                                                                                                │  Feature/T4136-18-identification-by-vin
- Conclusion: don't install phpdocumentor/reflection-docblock 3.1.1
- phpdocumentor/reflection 3.0.0 requires phpdocumentor/reflection-docblock ~2.0 -> satisfiable by phpdocumentor/reflection-docblock[2.0.0, 2.0.0a1, 2.0.0a2, 2.0.0a3, 2.0.1, 2.0.2, 2.0.3, 2.0.4].               │  master
- Can only install one of: phpdocumentor/reflection-docblock[2.0.0, 3.1.1].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.0a1, 3.1.1].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.0a2, 3.1.1].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.0a3, 3.1.1].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.1, 3.1.1].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.2, 3.1.1].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.3, 3.1.1].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.4, 3.1.1].
- Installation request for phpdocumentor/reflection-docblock (locked at 3.1.1) -> satisfiable by phpdocumentor/reflection-docblock[3.1.1].

这是我的composer.json

代码语言:javascript
复制
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
    "classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
},
"require": {
    "php": ">=5.3.9",
    "symfony/symfony": "2.8.*",
    "symfony/serializer": "~3.1.5",
    "doctrine/orm": "^2.4.8",
    "doctrine/doctrine-bundle": "~1.4",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~5.0",
    "sensio/framework-extra-bundle": "^3.0.2",
    "incenteev/composer-parameter-handler": "~2.0"
},
"require-dev": {
    "sensio/generator-bundle": "~3.0",
    "symfony/phpunit-bridge": "~2.7",
    "phpunit/phpunit": "5.5.*"
},
"scripts": {
    "symfony-scripts": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
    ],
    "post-install-cmd": [
        "@symfony-scripts"
    ],
    "post-update-cmd": [
        "@symfony-scripts"
    ]
},
"config": {
    "bin-dir": "bin",
    "platform": {
        "php": "5.6"
    }
},
"extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "symfony-assets-install": "relative",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    },
    "branch-alias": {
        "dev-master": "2.8-dev"
    }
}

}

我不知道具体问题在哪里,但我认为composer试图安装phpdocumentor/reflection的最后一个稳定版本(3.0.1)。这个包依赖于phpdocumentor/反射-docblock (~2.0),但它应该是3.1.1。

有什么办法解决这个问题吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-11-14 16:23:34

如果要安装phpdocumentor/reflection ~3.0包,则需要phpdocumentor/reflection-docblock ~2.0。问题是您已经安装了phpdocumentor/reflection-docblock ~3.1,因为phpspec/prophecy 1.6.1需要phpdocumentor/reflection-docblock (^2.0|^3.0.2)

好消息是,phpspec/prophecy可以很好地处理~2.0版本的phpdocumentor/reflection-docblock,因此您可以首先降低该包的级别。

代码语言:javascript
复制
composer require phpdocumentor/reflection-docblock:~2.0

然后,您可以在没有冲突的情况下要求phpdocumentor/reflection

代码语言:javascript
复制
composer require phpdocumentor/reflection
票数 5
EN

Stack Overflow用户

发布于 2016-11-14 15:42:20

似乎您已经安装了phpdocumentor/反射-docblock 3.1.1,并且这个包需要phpdocumentor/反射-docblock 3.0。

删除phpdocumentor/反射-docblock 3.1.1,并再次尝试安装phpdocumentor/reflexion

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40591973

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档