summaryrefslogtreecommitdiff
path: root/src/Renderer/Engine.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-12-03 23:39:50 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2019-07-08 01:58:06 +0200
commite9f157ec5ccdfae73b4c9e82c9ae7c37bcfa1513 (patch)
treefea2fdb1df183008f31f7827d9f83a5f6fc13cfb /src/Renderer/Engine.php
parentbcce2625a8cb0b630d945c6849014049869e10ce (diff)
Renderer: Added shared data
Diffstat (limited to 'src/Renderer/Engine.php')
-rw-r--r--src/Renderer/Engine.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/Renderer/Engine.php b/src/Renderer/Engine.php
new file mode 100644
index 00000000..60f1d686
--- /dev/null
+++ b/src/Renderer/Engine.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace Engelsystem\Renderer;
+
+abstract class Engine implements EngineInterface
+{
+ /** @var array */
+ protected $sharedData = [];
+
+ /**
+ * @param mixed[]|string $key
+ * @param null $value
+ */
+ public function share($key, $value = null)
+ {
+ if (!is_array($key)) {
+ $key = [$key => $value];
+ }
+
+ $this->sharedData = array_replace_recursive($this->sharedData, $key);
+ }
+}