Resp::createCommandWithArguments()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
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 Resp extends CommandAbstract implements CommandInterface
11
{
12
    protected static $command = 'JSON.RESP';
13
14
    private function __construct(
15
        string $key,
16
        Path $path
17
    ) {
18
        $this->arguments = [$key, $path->getPath()];
19
        // $this->responseCallback = function ($result) {return json_decode($result);};
20
    }
21
22
    public static function createCommandWithArguments(string $key, $path = '.') : CommandInterface
23
    {
24
        return new self(
25
            $key,
26
            new Path($path)
27
        );
28
    }
29
}
30