ArrayTrim   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 8
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A createCommandWithArguments() 0 11 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Redislabs\Module\ReJSON\Command;
5
6
use Redislabs\Interfaces\CommandInterface;
7
use Redislabs\Command\CommandAbstract;
8
use Redislabs\Module\ReJSON\Path;
9
10
final class ArrayTrim extends CommandAbstract implements CommandInterface
11
{
12
    protected static $command = 'JSON.ARRTRIM';
13
14
    private function __construct(
15
        string $key,
16
        Path $path,
17
        int $start,
18
        int $stop
19
    ) {
20
        $this->arguments = [$key, $path->getPath(), $start, $stop];
21
    }
22
23
    public static function createCommandWithArguments(
24
        string $key,
25
        string $path,
26
        int $start,
27
        int $stop
28
    ) : CommandInterface {
29
        return new self(
30
            $key,
31
            new Path($path),
32
            $start,
33
            $stop
34
        );
35
    }
36
}
37