Mercurial > hg > isophonics-drupal-site
comparison core/lib/Drupal/Core/Discovery/YamlDiscovery.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
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 } |