| Conditions | 2 |
| Paths | 1 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function register() |
||
| 30 | { |
||
| 31 | $this->app->singleton('centrifuge', function ($app) { |
||
| 32 | $config = $app->make('config')->get('broadcasting.connections.centrifuge'); |
||
| 33 | $http = new HttpClient(); |
||
| 34 | $redis = $app->make('redis')->connection($config['redis_connection']); |
||
| 35 | |||
| 36 | // for laravel 5.4 |
||
| 37 | if (! ($redis instanceof RedisClient)) { |
||
| 38 | $redis = $redis->client(); |
||
| 39 | } |
||
| 40 | |||
| 41 | return new Centrifuge($config, $http, $redis); |
||
| 42 | }); |
||
| 43 | |||
| 44 | $this->app->alias('centrifuge', 'LaraComponents\Centrifuge\Centrifuge'); |
||
| 45 | $this->app->alias('centrifuge', 'LaraComponents\Centrifuge\Contracts\Centrifuge'); |
||
| 46 | } |
||
| 47 | } |
||
| 48 |