Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / consolidation / robo / src / State / StateAwareTrait.php
diff --git a/vendor/consolidation/robo/src/State/StateAwareTrait.php b/vendor/consolidation/robo/src/State/StateAwareTrait.php
new file mode 100644 (file)
index 0000000..a1de1f1
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+namespace Robo\State;
+
+use Robo\State\Data;
+
+trait StateAwareTrait
+{
+    protected $state;
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getState()
+    {
+        return $this->state;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function setState(Data $state)
+    {
+        $this->state = $state;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function setStateValue($key, $value)
+    {
+        $this->state[$key] = $value;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function updateState(Data $update)
+    {
+        $this->state->update($update);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function resetState()
+    {
+        $this->state = new Data();
+    }
+}