Passed
Push — trunk ( f99c1c...cd7f4f )
by Christian
13:22 queued 13s
created

RedisMultiWrapper::exec()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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