ObjectLength   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

2 Methods

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