From f26ca8b7abf721ebc337655616ffd9253e706b5c Mon Sep 17 00:00:00 2001 From: "Sven Carstens [UDG]" Date: Thu, 16 Mar 2017 14:31:11 +0100 Subject: [PATCH] [FEATURE] Ignore packages which do not have a source entry. --- src/BaseCommand.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/BaseCommand.php b/src/BaseCommand.php index 8eedb8c..a3329e8 100644 --- a/src/BaseCommand.php +++ b/src/BaseCommand.php @@ -84,15 +84,17 @@ protected function reposFromLockfile($lockContent) $output = array(); - foreach ($lock['packages'] as $package) { - switch ($package['source']['type']) { - case 'git': - $output[$package['name']] = $package['source']; - break; - default: - throw new \LogicException("Bad package source type: '" . $package['source']['type'] . "'"); - } - } + foreach ($lock['packages'] as $package) { + if (isset($package['source'])) { + switch ($package['source']['type']) { + case 'git': + $output[$package['name']] = $package['source']; + break; + default: + throw new \LogicException("Bad package source type: '" . $package['source']['type'] . "'"); + } + } + } return $output; }