From 1d4185b844dd22718562fcfe77d3ad785aa2c8fa Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 23 Apr 2020 13:51:57 +0200 Subject: [PATCH] Recommend ocramius/package-versions fork if needed to solve dependencies --- src/Composer/DependencyResolver/SolverProblemsException.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Composer/DependencyResolver/SolverProblemsException.php b/src/Composer/DependencyResolver/SolverProblemsException.php index 082b4c4f7..2b58b707a 100644 --- a/src/Composer/DependencyResolver/SolverProblemsException.php +++ b/src/Composer/DependencyResolver/SolverProblemsException.php @@ -66,6 +66,10 @@ class SolverProblemsException extends \RuntimeException $text .= "\nUse the option --with-all-dependencies to allow updates and removals for packages currently locked to specific versions."; } + if (strpos($text, 'found composer-plugin-api[2.0.0] but it does not match') && strpos($text, '- ocramius/package-versions')) { + $text .= "\nocramius/package-versions only provides support for Composer 2 in 1.8+, which requires PHP 7.4.\nIf you can not upgrade PHP you can require composer/package-versions-deprecated to resolve this with PHP 7.0+.\n"; + } + // TODO remove before 2.0 final if (!class_exists('PHPUnit\Framework\TestCase', false)) { if (strpos($text, 'found composer-plugin-api[2.0.0] but it does not match')) {