Skip to content

Commit 62d5c38

Browse files
committed
bug #1044 Always include locked dev packages (wouterj)
This PR was merged into the 2.x branch. Discussion ---------- Always include locked dev packages It took me ages to find this hidden bug. When fetching the locked repository, Composer by default does not include dev packages. This means that conflicts for dev packages defined by Flex recipes were always completely ignored (like the `phpunit/phpunit: <9.6` conflict in our `symfony/phpunit-bridge` recipe). This creates big issues for my new PHPUnit recipe (symfony/recipes#1401), as the 10+ recipe is run for applications using PHPUnit 9. Commits ------- 05bcffd Always include locked dev packages
2 parents 8ce1acd + 05bcffd commit 62d5c38

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Downloader.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function getRecipes(array $operations): array
134134
$this->initialize();
135135

136136
if ($this->conflicts) {
137-
$lockedRepository = $this->composer->getLocker()->getLockedRepository();
137+
$lockedRepository = $this->composer->getLocker()->getLockedRepository(true);
138138
foreach ($this->conflicts as $conflicts) {
139139
foreach ($conflicts as $package => $versions) {
140140
foreach ($versions as $version => $conflicts) {

src/Flex.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ private function doesRecipeConflict(array $recipeData, OperationInterface $opera
872872
return false;
873873
}
874874

875-
$lockedRepository = $this->composer->getLocker()->getLockedRepository();
875+
$lockedRepository = $this->composer->getLocker()->getLockedRepository(true);
876876

877877
foreach ($recipeData['manifest']['conflict'] as $conflictingPackage => $constraint) {
878878
if ($lockedRepository->findPackage($conflictingPackage, $constraint)) {

0 commit comments

Comments
 (0)