Total Complexity | 4 |
Total Lines | 54 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
16 | class StatementCloseCommand extends PromiseCommand { |
||
17 | /** |
||
18 | * The identifier for this command. |
||
19 | * @var int |
||
20 | * @source |
||
21 | */ |
||
22 | const COMMAND_ID = 0x19; |
||
23 | |||
24 | /** |
||
25 | * @var \Plasma\DriverInterface |
||
26 | */ |
||
27 | protected $driver; |
||
28 | |||
29 | /** |
||
30 | * @var mixed |
||
31 | */ |
||
32 | protected $id; |
||
33 | |||
34 | /** |
||
35 | * Constructor. |
||
36 | * @param \Plasma\DriverInterface $driver |
||
37 | * @param mixed $id |
||
38 | */ |
||
39 | function __construct(\Plasma\DriverInterface $driver, $id) { |
||
40 | parent::__construct(); |
||
41 | |||
42 | $this->driver = $driver; |
||
43 | $this->id = $id; |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * Get the encoded message for writing to the database connection. |
||
48 | * @return string |
||
49 | */ |
||
50 | function getEncodedMessage(): string { |
||
51 | $this->finished = true; |
||
52 | return \chr(static::COMMAND_ID).$this->id; |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * Sends the next received value into the command. |
||
57 | * @param mixed $value |
||
58 | * @return void |
||
59 | */ |
||
60 | function onNext($value): void { |
||
61 | // Nothing to do |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * Whether the sequence ID should be resetted. |
||
66 | * @return bool |
||
67 | */ |
||
68 | function resetSequence(): bool { |
||
72 |