Skip to content

Commit 7958041

Browse files
committed
Keep only minimal information for the package lock
1 parent 7c7a216 commit 7958041

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Flex.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,8 @@ function ($value) {
420420
'n'
421421
);
422422
if ('n' === $answer) {
423-
// Remove the recipe from the lock to allow re-asking next time
424-
$this->lock->remove($recipe->getName());
423+
// Keep the package in lock but without recipe info, so the recipe can be applied later
424+
$this->lock->set($recipe->getName(), ['version' => $recipe->getPackage()->getPrettyVersion()]);
425425
continue;
426426
}
427427
if ('a' === $answer) {

tests/FlexTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function testContribRecipeNotApprovedIsRemovedFromLock()
171171

172172
$flex->record($this->mockPackageEvent($package));
173173
$flex->install($this->mockFlexEvent());
174-
$this->assertFalse($lock->has('contrib/package'), 'Recipe lock entry has been removed');
174+
$this->assertSame(['version' => '1.0.0'], $lock->get('contrib/package'));
175175

176176
// Verify the warning message was displayed
177177
$output = $io->getOutput();

0 commit comments

Comments
 (0)