From 9aca8f380b0191f9555edfb39863d1b14aef771b Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 10 Feb 2023 08:34:20 +0100 Subject: [PATCH 1/4] Fix keeping platform requirements when rebooting composer --- src/Flex.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Flex.php b/src/Flex.php index 005c53acf..4a3e76774 100644 --- a/src/Flex.php +++ b/src/Flex.php @@ -1033,6 +1033,9 @@ private function reinstall(Event $event, bool $update) $composer->getEventDispatcher(), $composer->getAutoloadGenerator() ); + if (method_exists($installer, 'setPlatformRequirementFilter')) { + $installer->setPlatformRequirementFilter(((array) $this->installer)["\0*\0platformRequirementFilter"]); + } if (!$update && method_exists($installer, 'setUpdateAllowList')) { $installer->setUpdateAllowList(['php']); From 07e35faad73004af8640a2f61fad3b5127c492e3 Mon Sep 17 00:00:00 2001 From: Alexandre Choura Date: Mon, 23 Oct 2023 15:48:06 +0200 Subject: [PATCH 2/4] fix: Replace str_starts_with by strncmp (PHP7 compatibility) --- src/Configurator/DockerComposeConfigurator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Configurator/DockerComposeConfigurator.php b/src/Configurator/DockerComposeConfigurator.php index 1f7589f22..257a35aa7 100644 --- a/src/Configurator/DockerComposeConfigurator.php +++ b/src/Configurator/DockerComposeConfigurator.php @@ -151,7 +151,7 @@ private function normalizeConfig(array $config): array return ['compose.yaml' => $config]; } - if (!str_starts_with($key, 'docker-')) { + if (strncmp($key, 'docker-', 7)) { continue; } From 24eb099033b66f884cf5081c7e4904daf66ad624 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 24 Oct 2023 15:35:38 +0200 Subject: [PATCH 3/4] Revert change made for the 1.x branch only --- src/Configurator/DockerComposeConfigurator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Configurator/DockerComposeConfigurator.php b/src/Configurator/DockerComposeConfigurator.php index 257a35aa7..1f7589f22 100644 --- a/src/Configurator/DockerComposeConfigurator.php +++ b/src/Configurator/DockerComposeConfigurator.php @@ -151,7 +151,7 @@ private function normalizeConfig(array $config): array return ['compose.yaml' => $config]; } - if (strncmp($key, 'docker-', 7)) { + if (!str_starts_with($key, 'docker-')) { continue; } From 42276be3bf961444110e6856c14cc9f047b65d05 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 30 Oct 2023 19:21:35 +0100 Subject: [PATCH 4/4] Decouple psr-http-message-bridge from extra.symfony.require for versions before 6.4 --- src/Cache.php | 4 ++++ src/PackageFilter.php | 1 + 2 files changed, 5 insertions(+) diff --git a/src/Cache.php b/src/Cache.php index 12f71dd94..6ecca1590 100644 --- a/src/Cache.php +++ b/src/Cache.php @@ -75,6 +75,10 @@ public function removeLegacyTags(array $data): array continue; } + if ('symfony/psr-http-message-bridge' === $name && 6.4 > $normalizedVersion) { + continue; + } + $constraint = new Constraint('==', $normalizedVersion); if ($rootConstraint && $rootConstraint->matches($constraint)) { diff --git a/src/PackageFilter.php b/src/PackageFilter.php index d1d9709b5..091bcd79b 100644 --- a/src/PackageFilter.php +++ b/src/PackageFilter.php @@ -80,6 +80,7 @@ public function removeLegacyPackages(array $data, RootPackageInterface $rootPack !isset($knownVersions['splits'][$name]) || array_intersect($versions, $lockedVersions[$name] ?? []) || (isset($rootConstraints[$name]) && !Intervals::haveIntersections($this->symfonyConstraints, $rootConstraints[$name])) + || ('symfony/psr-http-message-bridge' === $name && 6.4 > $versions[0]) )) { $filteredPackages[] = $package; continue;