summaryrefslogtreecommitdiff
path: root/src/Renderer/Engine.php
blob: e2ff23f2ca7149ebd68b344b62cb243bf71f73f3 (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): void
    {
        if (!is_array($key)) {
            $key = [$key => $value];
        }

        $this->sharedData = array_replace_recursive($this->sharedData, $key);
    }
}