summaryrefslogtreecommitdiff
path: root/src/Renderer/Engine.php
blob: 60f1d686031df1db5999980806298fb455dc4cc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);
    }
}