| Total Complexity | 7 |
| Total Lines | 68 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | abstract class Channel implements ChannelInterface |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var Client |
||
| 17 | */ |
||
| 18 | protected $client; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var integer |
||
| 22 | */ |
||
| 23 | protected $bufferSize; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Channel constructor. |
||
| 27 | * @param Client $client |
||
| 28 | */ |
||
| 29 | public function __construct(Client $client) |
||
| 30 | { |
||
| 31 | $this->client = $client; |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @return mixed|void |
||
| 36 | * @throws ConnectionException |
||
| 37 | */ |
||
| 38 | public function connect() |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @return Response |
||
| 50 | */ |
||
| 51 | public function disconnect(): Response |
||
| 52 | { |
||
| 53 | $message = $this->client->send(new QuitChannelCommand); |
||
| 54 | $this->client->disconnect(); |
||
| 55 | return $message; |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @return Response |
||
| 60 | */ |
||
| 61 | public function ping(): Response |
||
| 62 | { |
||
| 63 | return $this->client->send(new PingCommand); |
||
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @return Response |
||
| 68 | */ |
||
| 69 | public function read(): Response |
||
| 72 | } |
||
| 73 | |||
| 74 | /** |
||
| 75 | * @param Command $command |
||
| 76 | * @return Response |
||
| 77 | */ |
||
| 78 | public function send(Command $command): Response |
||
| 81 | } |
||
| 82 | } |