diff --git a/src/LocateDependencies/LocateDependenciesViaComposer.php b/src/LocateDependencies/LocateDependenciesViaComposer.php index 8bce2790..e913d4ed 100644 --- a/src/LocateDependencies/LocateDependenciesViaComposer.php +++ b/src/LocateDependencies/LocateDependenciesViaComposer.php @@ -4,6 +4,7 @@ namespace Roave\BackwardCompatibility\LocateDependencies; +use Composer\Filter\PlatformRequirementFilter\IgnoreAllPlatformRequirementFilter; use Composer\Installer; use Psl; use Psl\Env; @@ -49,7 +50,7 @@ public function __invoke(string $installationPath, bool $includeDevelopmentDepen * of composer, as we otherwise need to re-design how an {@see Installer} is constructed. */ $installer->setRunScripts(false); - $installer->setIgnorePlatformRequirements(true); + $installer->setPlatformRequirementFilter(new IgnoreAllPlatformRequirementFilter()); $installer->run(); }, $installationPath); diff --git a/test/unit/LocateDependencies/LocateDependenciesViaComposerTest.php b/test/unit/LocateDependencies/LocateDependenciesViaComposerTest.php index e483c4fb..8ab9a727 100644 --- a/test/unit/LocateDependencies/LocateDependenciesViaComposerTest.php +++ b/test/unit/LocateDependencies/LocateDependenciesViaComposerTest.php @@ -92,8 +92,7 @@ public function testWillLocateDependencies(): void $this ->composerInstaller ->expects(self::atLeastOnce()) - ->method('setIgnorePlatformRequirements') - ->with(true); + ->method('setPlatformRequirementFilter'); $this ->composerInstaller @@ -143,8 +142,7 @@ public function testDevelopmentDependenciesCanBeOptionallyInstalled(): void $this ->composerInstaller ->expects(self::atLeastOnce()) - ->method('setIgnorePlatformRequirements') - ->with(true); + ->method('setPlatformRequirementFilter'); $this ->composerInstaller