Conditions | 3 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
36 | public function run() |
||
37 | { |
||
38 | $redis = new \Redis(); |
||
39 | $redis->connect($this->host); |
||
40 | |||
41 | if ($this->auth) { |
||
42 | $redis->auth($this->auth); |
||
43 | } |
||
44 | |||
45 | $length = $redis->lLen($this->listName); |
||
46 | |||
47 | if ($length > $this->maxLength) { |
||
48 | return new Result(Result::STATUS_FAIL, 'Too many elements in list ("' . $length . '"). Maximum was ' . $this->maxLength); |
||
49 | } else { |
||
50 | return new Result(Result::STATUS_FAIL, $length . ' elements in list. Maximum was ' . $this->maxLength); |
||
51 | } |
||
59 |