mamuz / PhpDependencyAnalysis

Static code analysis to find violations in a dependency graph
http://mamuz.github.io/PhpDependencyAnalysis/
MIT License
561 stars 45 forks source link

Install fails in PHP 8.1 #58

Open fabpico opened 1 year ago

fabpico commented 1 year ago

Even after removing composer.lock, after running composer require --dev mamuz/php-dependency-analysis, following error happens:

Cannot use mamuz/php-dependency-analysis's latest version v2.0.2 as it requires php ^7.3 which is not satisfied by your platform.
./composer.json has been updated
Running composer update mamuz/php-dependency-analysis
Loading composer repositories with package information
Updating dependencies                                 
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - mamuz/php-dependency-analysis[v0.0.1, ..., v0.1.3] require symfony/console 2.5.* -> found symfony/console[v2.5.0, ..., v2.5.12] but it conflicts with your root composer.json require (^6.2).
    - mamuz/php-dependency-analysis[v0.2.0, ..., v0.5.0] require symfony/console 2.6.* -> found symfony/console[v2.6.0, ..., v2.6.13] but it conflicts with your root composer.json require (^6.2).
    - mamuz/php-dependency-analysis[v0.5.1, ..., v0.6.0] require symfony/console ~2.5 -> found symfony/console[v2.5.0, ..., v2.8.52] but it conflicts with your root composer.json require (^6.2).
    - mamuz/php-dependency-analysis[v0.6.1, v1.0.0, ..., v1.2.0] require symfony/console ~2.5|~3.0 -> found symfony/console[v2.5.0, ..., v2.8.52, v3.0.0, ..., v3.4.47] but it conflicts with your root composer.json require (^6.2).
    - mamuz/php-dependency-analysis[v1.3.0, ..., v1.3.1] require php ^5.6 || ^7.0 -> your php version (8.1.11) does not satisfy that requirement.
    - mamuz/php-dependency-analysis[v2.0.0, ..., v2.0.2] require php ^7.3 -> your php version (8.1.11) does not satisfy that requirement.
    - Root composer.json requires mamuz/php-dependency-analysis * -> satisfiable by mamuz/php-dependency-analysis[v0.0.1, ..., v0.6.1, v1.0.0, ..., v1.3.1, v2.0.0, v2.0.1, v2.0.2].
llaville commented 1 year ago

@fabpico This package is a bit outdated and only support PHP 7 See https://github.com/mamuz/PhpDependencyAnalysis/blob/v2.0.2/composer.json#L30 or even master branch !

Your platform is PHP 8.1.1

- mamuz/php-dependency-analysis[v2.0.0, ..., v2.0.2] require php ^7.3 -> your php version (8.1.11) does not satisfy that requirement.

So it's impossible to install latest version ! But You should be able to install v1.2.0

Check constraint with an online semver tool, if you're not sure : https://jubianchi.github.io/semver-check/#/constraint/^7.3

llaville commented 1 year ago

If you really want to install v2.0.2 (latest) at your own risk, you could bypass platform verification with composer.

composer require --dev --ignore-platform-req=php mamuz/php-dependency-analysis
fabpico commented 1 year ago

I am just asking to update the package compatibility to 8.1.