| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 36 | 5 | public static function createUrl(string $appId, string $cluster = null): string |
|
| 37 | { |
||
| 38 | $query = [ |
||
| 39 | 5 | 'client' => 'api-clients/pusher (https://php-api-clients.org/clients/pusher)', |
|
| 40 | 5 | 'protocol' => 7, |
|
| 41 | 5 | 'version' => ApiSettings::getVersion(), |
|
| 42 | ]; |
||
| 43 | |||
| 44 | 5 | $host = ($cluster !== null) ? "ws-{$cluster}.pusher.com" : 'ws.pusherapp.com'; |
|
| 45 | |||
| 46 | 5 | return 'wss://'.$host.'/app/' . |
|
| 47 | 5 | $appId . |
|
| 48 | 5 | '?' . \http_build_query($query) |
|
| 49 | ; |
||
| 50 | } |
||
| 51 | } |
||
| 52 |