diff --git a/lib/Drupal/Component/Discovery/YamlDiscovery.php b/lib/Drupal/Component/Discovery/YamlDiscovery.php index bf4ee15..1d147fd 100644 --- a/lib/Drupal/Component/Discovery/YamlDiscovery.php +++ b/lib/Drupal/Component/Discovery/YamlDiscovery.php @@ -48,7 +48,9 @@ public function __construct($name, array $directories) { public function findAll() { $all = array(); foreach ($this->findFiles() as $provider => $file) { - $all[$provider] = Yaml::decode(file_get_contents($file)); + // If a file is empty or its contents are commented out, return an empty + // array instead of NULL for type consistency. + $all[$provider] = Yaml::decode(file_get_contents($file)) ?: []; } return $all;