GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 96db4d...83db60 )
by Cees-Jan
04:34 queued 02:26
created

Msgpack::set()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace WyriHaximus\React\Cache;
4
5
use React\Cache\CacheInterface;
6
use React\Promise\PromiseInterface;
7
8
final class Msgpack implements CacheInterface
9
{
10
    /**
11
     * @var CacheInterface
12
     */
13
    private $cache;
14
15
    /**
16
     * @param CacheInterface $cache
17
     */
18 3
    public function __construct(CacheInterface $cache)
19
    {
20 3
        $this->cache = $cache;
21 3
    }
22
23
    /**
24
     * @param  string           $key
25
     * @return PromiseInterface
26
     */
27
    public function get($key)
28
    {
29 1
        return $this->cache->get($key)->then(function ($result) {
30 1
            return msgpack_unpack($result, true);
0 ignored issues
show
Unused Code introduced by
The call to msgpack_unpack() has too many arguments starting with true. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

30
            return /** @scrutinizer ignore-call */ msgpack_unpack($result, true);

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
31 1
        });
32
    }
33
34
    /**
35
     * @param  string           $key
36
     * @param  mixed            $value
37
     * @return PromiseInterface
38
     */
39 1
    public function set($key, $value)
40
    {
41 1
        return $this->cache->set($key, msgpack_pack($value));
42
    }
43
44
    /**
45
     * @param  string           $key
46
     * @return PromiseInterface
47
     */
48 1
    public function remove($key)
49
    {
50 1
        return $this->cache->remove($key);
51
    }
52
}
53