Passed
Push — trunk ( 711512...d883c7 )
by Christian
31:59 queued 18:57
created

RedisMultiWrapper::doCall()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 6
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Core\Test\Stub\Redis;
4
5
class RedisMultiWrapper extends \Redis
6
{
7
    use RedisMultiCompatibility;
8
9
    /**
10
     * @param array<mixed> $results
11
     */
12
    public function __construct(private readonly \Redis $redis, private array $results = [])
13
    {
14
    }
15
16
    /**
17
     * @return mixed[]
18
     */
19
    public function exec(): array
20
    {
21
        $ret = $this->results;
22
        $this->results = [];
23
24
        return $ret;
25
    }
26
27
    /**
28
     * @param array<mixed> $arguments
29
     *
30
     * @return RedisMultiWrapper
31
     */
32
    private function doCall(string $name, array $arguments)
33
    {
34
        // @phpstan-ignore-next-line
35
        $this->results[] = $this->redis->$name(...$arguments);
36
37
        return $this;
38
    }
39
}
40