Passed
Pull Request — master (#576)
by Alexander
05:20 queued 02:59
created

SimpleCacheInterfaceProxy::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Debug\CacheCollector;
6
7
use Psr\SimpleCache\CacheInterface;
0 ignored issues
show
Bug introduced by
The type Psr\SimpleCache\CacheInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
9
class SimpleCacheInterfaceProxy implements CacheInterface
10
{
11
    public function __construct(
12
        private CacheInterface $decorated,
13
        private CacheCollector $collector,
14
    ) {
15
    }
16
17
    public function get(string $key, mixed $default = null)
18
    {
19
        $this->collector->collectGet($key);
20
        return $this->decorated->{__FUNCTION__}(...func_get_args());
21
    }
22
23
    public function set(string $key, mixed $value, \DateInterval|int|null $ttl = null)
24
    {
25
        $this->collector->collectSet($key, $value, $ttl);
26
        return $this->decorated->{__FUNCTION__}(...func_get_args());
27
    }
28
29
    public function delete(string $key)
30
    {
31
        return $this->decorated->{__FUNCTION__}(...func_get_args());
32
    }
33
34
    public function clear()
35
    {
36
        return $this->decorated->{__FUNCTION__}(...func_get_args());
37
    }
38
39
    public function getMultiple(iterable $keys, mixed $default = null)
40
    {
41
        return $this->decorated->{__FUNCTION__}(...func_get_args());
42
    }
43
44
    public function setMultiple(iterable $values, \DateInterval|int|null $ttl = null)
45
    {
46
        return $this->decorated->{__FUNCTION__}(...func_get_args());
47
    }
48
49
    public function deleteMultiple(iterable $keys)
50
    {
51
        return $this->decorated->{__FUNCTION__}(...func_get_args());
52
    }
53
54
    public function has(string $key)
55
    {
56
        return $this->decorated->{__FUNCTION__}(...func_get_args());
57
    }
58
}
59