所需的依赖项未更新

时间:2018-12-31 14:39:54

标签: php composer-php version versioning

我正在使用composer更新一些软件包。我在项目中使用Laravel5.6。

我正在尝试的是PHPStan到版本0.10.7。我当前的版本是0.9.2

问题

当我尝试更新时,它会显示一条成功消息,但是当检查outdate软件包的输出时,它仍然过时。

我尝试过的

使用composer why-not phpstan/phpstan 0.10.7给了我以下输出:

laravel/laravel  my-branch-test  requires (for development)  phpstan/phpstan (^0.9.2)                      
phpstan/phpstan  0.10.7          requires                    nikic/php-parser (^4.0.2)                     
laravel/laravel  my-branch-test  does not require            nikic/php-parser (but v3.1.5 is installed)    
phpstan/phpstan  0.10.7          requires                    phpstan/phpdoc-parser (^0.3)                  
laravel/laravel  my-branch-test  does not require            phpstan/phpdoc-parser (but 0.2 is installed)  

然后,我尝试更新nikic/php-parserphpdoc-parser并重新运行composer update phpstan/phpstan,但这给了我与以前相同的结果。 (不更新)

更新:运行composer update phpstan/phpstan --with-dependencies给了我以下输出:(但仍未更新phpstan)

composer update phpstan/phpstan --with-dependencies
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Updating dependencies (including require-dev)                              
Package operations: 0 installs, 11 updates, 0 removals
  - Updating ocramius/package-versions (1.2.0 => 1.3.0): Loading from cache
  - Updating symfony/finder (v4.1.4 => v4.2.1): Loading from cache
  - Updating symfony/polyfill-mbstring (v1.9.0 => v1.10.0): Loading from cache
  - Updating jean85/pretty-package-versions (1.1 => 1.2): Loading from cache
  - Updating nette/utils (v2.4.9 => v2.5.3): Loading from cache
  - Updating nette/php-generator (v3.0.2 => v3.0.5): Loading from cache
  - Updating nette/neon (v2.4.2 => v2.4.3): Loading from cache
  - Updating nette/di (v2.4.10 => v2.4.14): Loading from cache
  - Updating nette/bootstrap (v2.4.5 => v2.4.6): Loading from cache
  - Updating nette/finder (v2.4.1 => v2.4.2): Loading from cache
  - Updating nette/robot-loader (v3.0.3 => v3.1.0): Loading from cache
Package sebastian/git is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
Discovered Package: barryvdh/laravel-debugbar
Discovered Package: caffeinated/modules
Discovered Package: fideloper/proxy
Discovered Package: jenssegers/agent
Discovered Package: laravel/tinker
Discovered Package: rap2hpoutre/laravel-log-viewer
Discovered Package: rcrowe/twigbridge
Package manifest generated successfully.
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class

代码

在我的composer.json文件中,该软件包被列为:

"require-dev": {
    "phpstan/phpstan": "^0.9.2",

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

这里的问题是我正在使用的其他软件包也使用了nikic/php-parser软件包,但是仅考虑了不间断的更改(nikic/php-parser":"^3.0"),“阻止”了对{{1}的升级}。

由于作曲者can't install two versions of the same package,我的解决方案暂时没有更新> 4.0

我将等待需要phpstan的库将其要求更新为nikic/php-parser或更高版本,或者将来会更改这些软件包。