Skip to content

Commit

Permalink
Updated discovery component
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateu Aguiló Bosch committed Apr 17, 2015
1 parent ae461be commit 7082fa8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Drupal/Component/Discovery/YamlDiscovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7082fa8

Please sign in to comment.