Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / consolidation / robo / src / Config / Config.php
index 3da9e5a93364c42736a3559d8034a7908970a209..78b135a32a5ffa26e2dd451c51a2db1f614a1883 100644 (file)
@@ -1,7 +1,10 @@
 <?php
 namespace Robo\Config;
 
-class Config extends \Consolidation\Config\Config implements GlobalOptionDefaultValuesInterface
+use Consolidation\Config\Util\ConfigOverlay;
+use Consolidation\Config\ConfigInterface;
+
+class Config extends ConfigOverlay implements GlobalOptionDefaultValuesInterface
 {
     const PROGRESS_BAR_AUTO_DISPLAY_INTERVAL = 'options.progress-delay';
     const DEFAULT_PROGRESS_DELAY = 2;
@@ -17,10 +20,38 @@ class Config extends \Consolidation\Config\Config implements GlobalOptionDefault
      */
     public function __construct(array $data = null)
     {
-        parent::__construct($data);
+        parent::__construct();
+
+        $this->import($data);
         $this->defaults = $this->getGlobalOptionDefaultValues();
     }
 
+    /**
+     * {@inheritdoc}
+     */
+    public function import($data)
+    {
+        return $this->replace($data);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function replace($data)
+    {
+        $this->getContext(ConfigOverlay::DEFAULT_CONTEXT)->replace($data);
+        return $this;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function combine($data)
+    {
+        $this->getContext(ConfigOverlay::DEFAULT_CONTEXT)->combine($data);
+        return $this;
+    }
+
     /**
      * Return an associative array containing all of the global configuration
      * options and their default values.