RuntimeCache   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 3 1
A set() 0 3 1
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