From a02802b109c327894fb5513badb1fdd095e30aa3 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 8 Jun 2021 21:12:49 +0200 Subject: [PATCH] Warn 1.x users when a package is not found that it may be due to our deprecation policy --- src/Composer/DependencyResolver/SolverProblemsException.php | 2 +- tests/Composer/Test/DependencyResolver/SolverTest.php | 1 + .../Test/Fixtures/installer/broken-deps-do-not-replace.test | 1 + tests/Composer/Test/Fixtures/installer/solver-problems.test | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Composer/DependencyResolver/SolverProblemsException.php b/src/Composer/DependencyResolver/SolverProblemsException.php index 142895697..a39e90ddd 100644 --- a/src/Composer/DependencyResolver/SolverProblemsException.php +++ b/src/Composer/DependencyResolver/SolverProblemsException.php @@ -43,7 +43,7 @@ class SolverProblemsException extends \RuntimeException } if (strpos($text, 'could not be found') || strpos($text, 'no matching package found')) { - $text .= "\nPotential causes:\n - A typo in the package name\n - The package is not available in a stable-enough version according to your minimum-stability setting\n see for more details.\n - It's a private package and you forgot to add a custom repository to find it\n\nRead for further common problems."; + $text .= "\nPotential causes:\n - This package is not installable via Composer 1.x, see \n - A typo in the package name\n - The package is not available in a stable-enough version according to your minimum-stability setting\n see for more details.\n - It's a private package and you forgot to add a custom repository to find it\n\nRead for further common problems."; } if ($hasExtensionProblems) { diff --git a/tests/Composer/Test/DependencyResolver/SolverTest.php b/tests/Composer/Test/DependencyResolver/SolverTest.php index 4dadee7d8..a1b51aa3a 100644 --- a/tests/Composer/Test/DependencyResolver/SolverTest.php +++ b/tests/Composer/Test/DependencyResolver/SolverTest.php @@ -709,6 +709,7 @@ class SolverTest extends TestCase $msg .= " - Installation request for a -> satisfiable by A[1.0].\n"; $msg .= " - A 1.0 requires b >= 2.0 -> no matching package found.\n\n"; $msg .= "Potential causes:\n"; + $msg .= " - This package is not installable via Composer 1.x, see \n"; $msg .= " - A typo in the package name\n"; $msg .= " - The package is not available in a stable-enough version according to your minimum-stability setting\n"; $msg .= " see for more details.\n"; diff --git a/tests/Composer/Test/Fixtures/installer/broken-deps-do-not-replace.test b/tests/Composer/Test/Fixtures/installer/broken-deps-do-not-replace.test index db4ef23c0..9f54b71b0 100644 --- a/tests/Composer/Test/Fixtures/installer/broken-deps-do-not-replace.test +++ b/tests/Composer/Test/Fixtures/installer/broken-deps-do-not-replace.test @@ -31,6 +31,7 @@ Your requirements could not be resolved to an installable set of packages. - Installation request for b/b 1.* -> satisfiable by b/b[1.0.0]. Potential causes: + - This package is not installable via Composer 1.x, see - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting see for more details. diff --git a/tests/Composer/Test/Fixtures/installer/solver-problems.test b/tests/Composer/Test/Fixtures/installer/solver-problems.test index cab45f9dc..5da2e4fea 100644 --- a/tests/Composer/Test/Fixtures/installer/solver-problems.test +++ b/tests/Composer/Test/Fixtures/installer/solver-problems.test @@ -52,6 +52,7 @@ Your requirements could not be resolved to an installable set of packages. - requirer/pkg 1.0.0 requires dependency/pkg 1.0.0 -> satisfiable by dependency/pkg[1.0.0] but these conflict with your requirements or minimum-stability. Potential causes: + - This package is not installable via Composer 1.x, see - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting see for more details.