| Total Complexity | 8 |
| Total Lines | 67 |
| Duplicated Lines | 0 % |
| Coverage | 46.67% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class ExprMessage implements MessageInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var OptionsInterface |
||
| 13 | */ |
||
| 14 | private $options; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | private $query; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var int |
||
| 23 | */ |
||
| 24 | private $queryType; |
||
| 25 | |||
| 26 | public function __construct(int $queryType = null, string $query = '', OptionsInterface $options = null) |
||
| 27 | { |
||
| 28 | $this->queryType = $queryType ?? QueryType::START; |
||
| 29 | $this->query = $query ?? ''; |
||
| 30 | $this->options = $options ?? new Options(); |
||
| 31 | 2 | } |
|
| 32 | |||
| 33 | 2 | public function getQueryType(): int |
|
| 34 | 2 | { |
|
| 35 | 2 | return $this->queryType; |
|
| 36 | 2 | } |
|
| 37 | |||
| 38 | public function setCommand(int $queryType): MessageInterface |
||
| 39 | { |
||
| 40 | $this->queryType = $queryType; |
||
| 41 | |||
| 42 | return $this; |
||
| 43 | } |
||
| 44 | |||
| 45 | public function setQuery($query): MessageInterface |
||
| 46 | { |
||
| 47 | $this->query = (string) $query; |
||
| 48 | |||
| 49 | return $this; |
||
| 50 | } |
||
| 51 | |||
| 52 | public function getOptions(): OptionsInterface |
||
| 53 | { |
||
| 54 | return $this->options; |
||
| 55 | } |
||
| 56 | |||
| 57 | public function setOptions(OptionsInterface $options): MessageInterface |
||
| 58 | { |
||
| 59 | $this->options = $options; |
||
| 60 | |||
| 61 | return $this; |
||
| 62 | } |
||
| 63 | |||
| 64 | public function toArray(): array |
||
| 70 | ]; |
||
| 71 | 1 | } |
|
| 72 | |||
| 73 | public function jsonSerialize(): array |
||
| 76 | } |
||
| 77 | } |
||
| 78 |