Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AqwSocketClient\Interfaces; |
| 6 | |
| 7 | use AqwSocketClient\Packet; |
| 8 | |
| 9 | /** |
| 10 | * Marks a class as a **command** or **action** that should be sent |
| 11 | * from the client back to the AQW server. |
| 12 | * |
| 13 | * Implementations are expected to contain all necessary data and logic |
| 14 | * to be converted into a sendable packet. |
| 15 | */ |
| 16 | interface CommandInterface |
| 17 | { |
| 18 | /** |
| 19 | * Converts the command object into a ready-to-send {@see AqwSocketClient\Packet} object. |
| 20 | * |
| 21 | * This method handles the serialization of the command data into the |
| 22 | * format required by the AQW server protocol. |
| 23 | * |
| 24 | * @return Packet The final packet object ready for transmission. |
| 25 | */ |
| 26 | public function pack(): Packet; |
| 27 | } |