| Total Complexity | 4 |
| Total Lines | 18 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | class WSBootloader extends Bootloader |
||
| 19 | { |
||
| 20 | protected const DEPENDENCIES = [WebsocketsBootloader::class]; |
||
| 21 | |||
| 22 | public function boot(WebsocketsBootloader $ws, EnvironmentInterface $env): void |
||
| 23 | { |
||
| 24 | if ($env->get('RR_BROADCAST_PATH') === null) { |
||
| 25 | return; |
||
| 26 | } |
||
| 27 | |||
| 28 | $ws->authorizeServer($env->get('WS_SERVER_CALLBACK')); |
||
| 29 | |||
| 30 | if ($env->get('WS_TOPIC_CALLBACK') !== null) { |
||
| 31 | $ws->authorizeTopic('topic', $env->get('WS_TOPIC_CALLBACK')); |
||
| 32 | } |
||
| 33 | |||
| 34 | if ($env->get('WS_TOPIC_WILDCARD_CALLBACK') !== null) { |
||
| 35 | $ws->authorizeTopic('wildcard.{id}', $env->get('WS_TOPIC_WILDCARD_CALLBACK')); |
||
| 36 | } |
||
| 39 |