ObjectLength::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\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