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, '/'); }