| Total Complexity | 5 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 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 |
||
| 51 | } |
||
| 52 | |||
| 53 | public function getParameters(): array |
||
| 56 | } |
||
| 57 | } |
||
| 58 |