Delete   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 6
dl 0
loc 14
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createCommandWithArguments() 0 5 2
A __construct() 0 3 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 Delete extends CommandAbstract implements CommandInterface
11
{
12
    protected static $command = 'JSON.DEL';
13
14
    private function __construct(string $key, Path $path)
15
    {
16
        $this->arguments = [$key, $path->getPath()];
17
    }
18
19
    public static function createCommandWithArguments(string $key, string $path) : CommandInterface
20
    {
21
        return new self(
22
            $key,
23
            $path ? new Path($path) : new Path()
24
        );
25
    }
26
}
27