diff --git a/src/Composer/Package/Loader/ArrayLoader.php b/src/Composer/Package/Loader/ArrayLoader.php index 72e0df76a..47b314e33 100644 --- a/src/Composer/Package/Loader/ArrayLoader.php +++ b/src/Composer/Package/Loader/ArrayLoader.php @@ -271,7 +271,7 @@ class ArrayLoader implements LoaderInterface } if (!empty($config['keywords']) && \is_array($config['keywords'])) { - $package->setKeywords($config['keywords']); + $package->setKeywords(array_map('strval', $config['keywords'])); } if (!empty($config['license'])) { diff --git a/src/Composer/Package/Loader/ValidatingArrayLoader.php b/src/Composer/Package/Loader/ValidatingArrayLoader.php index 1bcd294b5..2977091fc 100644 --- a/src/Composer/Package/Loader/ValidatingArrayLoader.php +++ b/src/Composer/Package/Loader/ValidatingArrayLoader.php @@ -571,7 +571,7 @@ class ValidatingArrayLoader implements LoaderInterface continue; } - if ($regex && !Preg::isMatch('{^'.$regex.'$}u', $value)) { + if ($regex && !Preg::isMatch('{^'.$regex.'$}u', (string) $value)) { $this->warnings[] = $property.'.'.$key.' : invalid value ('.$value.'), must match '.$regex; unset($this->config[$property][$key]); $pass = false;