Query   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 4
c 2
b 1
f 0
dl 0
loc 12
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A createCommandWithArguments() 0 3 1
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