Variable::init()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 2
ccs 1
cts 1
cp 1
crap 1
rs 10
1
<?php
2
3
namespace kalanis\kw_cache\Simple;
4
5
6
use kalanis\kw_cache\Interfaces\ICache;
7
8
9
/**
10
 * Class Variable
11
 * @package kalanis\kw_cache\Simple
12
 * Caching content in variable
13
 */
14
class Variable implements ICache
15
{
16
    protected ?string $content = null;
17
18 4
    public function init(array $what): void
19
    {
20 4
    }
21
22 6
    public function exists(): bool
23
    {
24 6
        return !is_null($this->content);
25
    }
26
27 7
    public function set(string $content): bool
28
    {
29 7
        $this->content = $content;
30 7
        return true;
31
    }
32
33 5
    public function get(): string
34
    {
35 5
        return strval($this->content);
36
    }
37
38 4
    public function clear(): void
39
    {
40 4
        $this->content = null;
41 4
    }
42
}
43