RuntimeCache::get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace ICanBoogie\CLDR\Cache;
4
5
use ICanBoogie\CLDR\Cache;
6
7
final class RuntimeCache implements Cache
8
{
9
    /**
10
     * @var array<string, mixed>
11
     */
12
    private array $cache = [];
13
14
    /**
15
     * @inheritDoc
16
     */
17
    public function get(string $path): ?array
18
    {
19
        return $this->cache[$path] ?? null;
20
    }
21
22
    /**
23
     * @inheritDoc
24
     */
25
    public function set(string $path, array $data): void
26
    {
27
        $this->cache[$path] = $data;
28
    }
29
}
30