Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version conflict with psr/cache v3 #522

Closed
mikemand opened this issue Jul 26, 2021 · 4 comments
Closed

Version conflict with psr/cache v3 #522

mikemand opened this issue Jul 26, 2021 · 4 comments

Comments

@mikemand
Copy link

Q A
Bug report? yes
Feature request? no
Library version 2.0.1

Trying to install PHP Insights into a project that already has psr/cache installed at v3 causes Composer to complain. It appears that symfony/cache, which this package relies on, locks psr/cache to ^1.0|^2.0. It looks like I already have doctrine/annotations:^1.13.1 installed in my project (which doesn't limit which version of psr/cache to use), which is in turn required by PHP-CS-Fixer, and (oddly) symfony/routing.

Maybe this is an issue for symfony/cache instead, but I figure this would be a good place to start.

A very simple fix for anyone else that has this problem but still wants to use PHP Insights: composer require --dev --with-all-dependencies nunomaduro/phpinsights - which should automatically downgrade psr/cache to v2 for you. If that doesn't work, simply require psr/cache:^2.0 and then install this package.

@tuarrep
Copy link

tuarrep commented Jul 29, 2021

On my side psr/cache is a dependency required by php-cs-fixer (through doctrine/annotations) too.

I've installed nunomaduro/phpinsight with --with-all-dependencies flag and my php-cs-fixed still works.

@LocalHeroPro
Copy link

Update psr/simple-cache to v3 from v1 (2017 year)

$ composer require psr/simple-cache
Using version ^3.0 for psr/simple-cache
./composer.json has been updated
Running composer update psr/simple-cache
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires nunomaduro/phpinsights ^2.1 -> satisfiable by nunomaduro/phpinsights[v2.1.0].
    - nunomaduro/phpinsights v2.1.0 requires psr/simple-cache ^1.0 -> found psr/simple-cache[1.0.0, 1.0.1] but it conflicts with your root composer.json require (^3.0).


Installation failed, reverting ./composer.json to its original content.

or

$ composer outdated
Color legend:
- patch or minor release available - update recommended
- major release available - update possible
psr/simple-cache 1.0.1 3.0.0 Common interfaces for simple caching

@JustSteveKing
Copy link
Collaborator

It sounds like circular dependencies are causing an issue. One of the upcoming tasks is to assess dependencies and see how we can handle these - so closing for now for further investigation.

cmgmyr pushed a commit that referenced this issue May 27, 2022
* Allow psr/simple-cache ^2.0 and ^3.0

* Exclude psr/simple-cache:^3.0 on symfony:^4.4
@f-lombardo
Copy link

It seems I'm exeperiencing the opposite problem. I use psr/simple-cache v 2.0 and I'm getting this error:

Fatal error: Uncaught LogicException: psr/simple-cache 3.0+ is not compatible with this version of symfony/cache. Please upgrade symfony/cache to 6.0+ or downgrade psr/simple-cache to 1.x or 2.x. in /var/www/symfony/vendor/symfony/cache/Psr16Cache.php:23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants