Completed
Push — master ( 785494...d2f1e8 )
by Tomasz
02:29
created

Command::getParameters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 *
4
 * This file is part of the Aggrego.
5
 * (c) Tomasz Kunicki <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 */
11
12
namespace Aggrego\Neo4jIntegration\Api\Command\RunCommand;
13
14
use Aggrego\CommandConsumer\Command as CommandConsumer;
15
use Aggrego\CommandConsumer\Name;
16
use Assert\Assertion;
17
18
class Command implements CommandConsumer
19
{
20
    private const NAME = 'neo4j_integration.run_command';
21
22
    /** @var string */
23
    private $query;
24
25
    /** @var array */
26
    private $parameters;
27
28
    public function __construct(string $query, array $parameters = [])
29
    {
30
        Assertion::notEmpty($query);
31
        $this->query = $query;
32
        $this->parameters = $parameters;
33
    }
34
35
    public function getName(): Name
36
    {
37
        return new Name(self::NAME);
38
    }
39
40
    public function getPayload(): array
41
    {
42
        return [
43
            'query' => $this->query,
44
            'parameters' => $this->parameters
45
        ];
46
    }
47
48
    public function getCypherQuery(): string
49
    {
50
        return $this->query;
51
    }
52
53
    public function getParameters(): array
54
    {
55
        return $this->parameters;
56
    }
57
}
58