From 4d665f59b0dad088025cdcefc544dd9ad7f73b85 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 27 Feb 2015 12:20:42 +0000 Subject: [PATCH] Create lock if we only have platform dependencies --- src/Composer/Package/Locker.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Composer/Package/Locker.php b/src/Composer/Package/Locker.php index 40ff8907c..171cf0362 100644 --- a/src/Composer/Package/Locker.php +++ b/src/Composer/Package/Locker.php @@ -258,7 +258,10 @@ class Locker $lock['packages-dev'] = $this->lockPackages($devPackages); } - if (empty($lock['packages']) && empty($lock['packages-dev'])) { + $lock['platform'] = $platformReqs; + $lock['platform-dev'] = $platformDevReqs; + + if (empty($lock['packages']) && empty($lock['packages-dev']) && empty($lock['platform']) && empty($lock['platform-dev'])) { if ($this->lockFile->exists()) { unlink($this->lockFile->getPath()); } @@ -266,9 +269,6 @@ class Locker return false; } - $lock['platform'] = $platformReqs; - $lock['platform-dev'] = $platformDevReqs; - if (!$this->isLocked() || $lock !== $this->getLockData()) { $this->lockFile->write($lock); $this->lockDataCache = null;