Query::createCommandWithArguments()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Redislabs\Module\RedisGraph\Command;
6
7
use Redislabs\Interfaces\CommandInterface;
8
use Redislabs\Command\CommandAbstract;
9
use Redislabs\Module\RedisGraph\Interfaces\QueryInterface;
10
11
final class Query extends CommandAbstract implements CommandInterface
12
{
13
    protected static $command = 'GRAPH.QUERY';
14
15
    private function __construct(string $name, string $queryString)
16
    {
17
        $this->arguments = [$name, $queryString, ' --compact'];
18
    }
19
20
    public static function createCommandWithArguments(QueryInterface $query): CommandInterface
21
    {
22
        return new self($query->getName(), $query->getQueryString());
23
    }
24
}
25