| Total Complexity | 5 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Coverage | 84.62% |
| 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 mixed |
||
| 26 | */ |
||
| 27 | protected $id; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Constructor. |
||
| 31 | * @param \Plasma\DriverInterface $driver |
||
| 32 | * @param mixed $id |
||
| 33 | */ |
||
| 34 | 38 | function __construct(\Plasma\DriverInterface $driver, $id) { |
|
| 35 | 38 | parent::__construct($driver); |
|
| 36 | 38 | $this->id = $id; |
|
| 37 | 38 | } |
|
| 38 | |||
| 39 | /** |
||
| 40 | * Get the encoded message for writing to the database connection. |
||
| 41 | * @return string |
||
| 42 | */ |
||
| 43 | 37 | function getEncodedMessage(): string { |
|
| 44 | 37 | $this->finished = true; |
|
| 45 | 37 | return \chr(static::COMMAND_ID).\Plasma\BinaryBuffer::writeInt4($this->id); |
|
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Sends the next received value into the command. |
||
| 50 | * @param mixed $value |
||
| 51 | * @return void |
||
| 52 | */ |
||
| 53 | function onNext($value): void { |
||
| 54 | // Nothing to do |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Whether this command sets the connection as busy. |
||
| 59 | * @return bool |
||
| 60 | */ |
||
| 61 | 37 | function waitForCompletion(): bool { |
|
| 62 | 37 | return false; |
|
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Whether the sequence ID should be resetted. |
||
| 67 | * @return bool |
||
| 68 | */ |
||
| 69 | 37 | function resetSequence(): bool { |
|
| 71 | } |
||
| 72 | } |
||
| 73 |