Version 1
[yaffs-website] / web / core / lib / Drupal / Core / Discovery / YamlDiscovery.php
1 <?php
2
3 namespace Drupal\Core\Discovery;
4
5 use Drupal\Component\Discovery\YamlDiscovery as ComponentYamlDiscovery;
6 use Drupal\Core\Serialization\Yaml;
7
8 /**
9  * Provides discovery for YAML files within a given set of directories.
10  *
11  * This overrides the Component file decoding with the Core YAML implementation.
12  */
13 class YamlDiscovery extends ComponentYamlDiscovery {
14
15   /**
16    * {@inheritdoc}
17    */
18   protected function decode($file) {
19     return Yaml::decode(file_get_contents($file)) ?: [];
20   }
21
22 }