From bb375b1e751682aea1341ebbb696c017546aba7e Mon Sep 17 00:00:00 2001 From: Joakim Israelsson Date: Thu, 15 May 2014 13:36:40 +0200 Subject: [PATCH] Only use "platform" config if it is an array. Another option could have been to adjust the test that failed so a platform array is returned from the mock config object but this feels more robust. If "platform" config is set to a non-array value it is silently ignored now. --- src/Composer/Installer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index 079a5a6e5..57680600c 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -196,7 +196,9 @@ class Installer // create installed repo, this contains all local packages + platform packages (php & extensions) $localRepo = $this->repositoryManager->getLocalRepository(); - $platformRepo = new PlatformRepository($this->config->get('platform')); + $platformOverride = $this->config->get('platform'); + $platformOverride = is_array($platformOverride) ? $platformOverride : array(); + $platformRepo = new PlatformRepository($platformOverride); $repos = array( $localRepo, new InstalledArrayRepository(array($installedRootPackage)),