Completed
Push — master ( 953783...055045 )
by Dominik
02:02
created

NullModelCache::has()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\Model\Cache;
6
7
use Chubbyphp\Model\ModelInterface;
8
9
final class NullModelCache implements ModelCacheInterface
10
{
11
    /**
12
     * @param ModelInterface $model
13
     *
14
     * @return ModelCacheInterface
15
     */
16
    public function set(ModelInterface $model): ModelCacheInterface
17
    {
18
        return $this;
19
    }
20
21
    /**
22
     * @param string $id
23
     *
24
     * @return bool
25
     */
26
    public function has(string $id): bool
27
    {
28
        return false;
29
    }
30
31
    /**
32
     * @param string $id
33
     *
34
     * @return ModelInterface
35
     *
36
     * @throws ModelNotFoundException
37
     */
38
    public function get(string $id)
39
    {
40
        throw ModelNotFoundException::fromId($id);
41
    }
42
43
    /**
44
     * @param string $id
45
     *
46
     * @return ModelCacheInterface
47
     */
48
    public function remove(string $id): ModelCacheInterface
49
    {
50
        return $this;
51
    }
52
}
53