From 6a50dbd46dee201e2952c8feda25acf28784721e Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 23 Apr 2012 10:14:02 +0200 Subject: [PATCH] Error out on wrong bin config --- src/Composer/Package/Loader/ArrayLoader.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Composer/Package/Loader/ArrayLoader.php b/src/Composer/Package/Loader/ArrayLoader.php index ae5678375..475fd122c 100644 --- a/src/Composer/Package/Loader/ArrayLoader.php +++ b/src/Composer/Package/Loader/ArrayLoader.php @@ -58,7 +58,10 @@ class ArrayLoader $package->setExtra($config['extra']); } - if (isset($config['bin']) && is_array($config['bin'])) { + if (isset($config['bin'])) { + if (!is_array($config['bin'])) { + throw new \UnexpectedValueException('Package '.$config['name'].'\'s bin key should be an array, '.gettype($config['bin']).' given.'); + } foreach ($config['bin'] as $key => $bin) { $config['bin'][$key]= ltrim($bin, '/'); }