Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / vendor / drush / drush / src / Config / Loader / YamlConfigLoader.php
1 <?php
2
3 namespace Drush\Config\Loader;
4
5 use Drush\Internal\Config\Yaml\Yaml;
6 use Consolidation\Config\Loader\ConfigLoader;
7
8 /**
9  * Load configuration files, and fill in any property values that
10  * need to be expanded.
11  */
12 class YamlConfigLoader extends ConfigLoader
13 {
14     public function load($path)
15     {
16         $this->setSourceName($path);
17
18         // We silently skip any nonexistent config files, so that
19         // clients may simply `load` all of their candidates.
20         if (!file_exists($path)) {
21             $this->config = [];
22             return $this;
23         }
24         $this->config = (array) Yaml::parse(file_get_contents($path));
25         return $this;
26     }
27 }