| Total Complexity | 8 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class Application implements WampServerInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @param string JSON'ified string we'll receive from ZeroMQ |
||
|
|
|||
| 15 | */ |
||
| 16 | public function notify($entry) |
||
| 17 | { |
||
| 18 | $entryData = json_decode($entry, true); |
||
| 19 | } |
||
| 20 | |||
| 21 | public function onPublish(ConnectionInterface $conn, $topic, $event, array $exclude, array $eligible): void |
||
| 22 | { |
||
| 23 | $topic->broadcast($event); |
||
| 24 | } |
||
| 25 | |||
| 26 | public function onCall(ConnectionInterface $conn, $id, $topic, array $params): void |
||
| 27 | { |
||
| 28 | // $conn->callError($id, $topic, 'RPC not supported on this demo'); |
||
| 29 | } |
||
| 30 | |||
| 31 | // No need to anything, since WampServer adds and removes subscribers to Topics automatically |
||
| 32 | public function onSubscribe(ConnectionInterface $conn, $topic): void |
||
| 33 | { |
||
| 34 | } |
||
| 35 | |||
| 36 | public function onUnSubscribe(ConnectionInterface $conn, $topic): void |
||
| 38 | |||
| 39 | } |
||
| 40 | |||
| 41 | public function onOpen(ConnectionInterface $conn): void |
||
| 42 | { |
||
| 43 | // Verify jwt token |
||
| 44 | // Subscribe user to all required channels|events |
||
| 45 | echo "onOpen\n"; |
||
| 46 | } |
||
| 47 | |||
| 48 | public function onClose(ConnectionInterface $conn): void |
||
| 49 | { |
||
| 50 | // UnSubscribe user from channels|events |
||
| 51 | echo "onClose\n"; |
||
| 52 | } |
||
| 53 | |||
| 54 | public function onError(ConnectionInterface $conn, Exception $e): void |
||
| 58 | } |
||
| 59 | } |
||
| 60 |