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

RedisMultiCompatibility   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 3
c 2
b 0
f 0
dl 0
loc 10
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A sMembers() 0 3 1
A del() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Core\Test\Stub\Redis;
4
5
if (version_compare(phpversion('redis') ?: '0.0.0', '6.0.0', '>=')) {
6
    trait RedisMultiCompatibility
7
    {
8
        public function del(array|string $key, string ...$other_keys): \Redis|int|false
9
        {
10
            return $this->doCall('del', [$key, ...$other_keys]);
0 ignored issues
show
Bug introduced by
It seems like doCall() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

10
            return $this->/** @scrutinizer ignore-call */ doCall('del', [$key, ...$other_keys]);
Loading history...
11
        }
12
13
        public function sMembers(string $key): RedisMultiWrapper
14
        {
15
            return $this->doCall('sMembers', [$key]);
16
        }
17
    }
18
} else {
19
    trait RedisMultiCompatibility
20
    {
21
        public function del($key1, ...$otherKeys)
22
        {
23
            return $this->doCall('del', [$key1, ...$otherKeys]);
24
        }
25
26
        public function sMembers($key)
27
        {
28
            return $this->doCall('sMembers', [$key]);
29
        }
30
    }
31
}
32