SimpleCache   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 17
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A set() 0 3 1
A has() 0 3 1
A get() 0 3 1
1
<?php
2
3
namespace Startwind\Forrest\Enrichment\EnrichFunction\Cache;
4
5
class SimpleCache
6
{
7
    private array $values = [];
8
9
    public function set(string $key, mixed $value): void
10
    {
11
        $this->values[$key] = $value;
12
    }
13
14
    public function get(string $key): mixed
15
    {
16
        return $this->values[$key];
17
    }
18
19
    public function has(string $key): bool
20
    {
21
        return array_key_exists($key, $this->values);
22
    }
23
}
24