AsyncRedisQueue   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 16
rs 10
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConnection() 0 9 4
1
<?php
2
3
namespace BeyondCode\LaravelWebSockets\Queue;
4
5
use BeyondCode\LaravelWebSockets\Contracts\ChannelManager;
6
use Illuminate\Queue\RedisQueue;
7
8
class AsyncRedisQueue extends RedisQueue
9
{
10
    /**
11
     * Get the connection for the queue.
12
     *
13
     * @return \BeyondCode\LaravelWebSockets\Contracts\ChannelManager|\Illuminate\Redis\Connections\Connection
14
     */
15
    public function getConnection()
16
    {
17
        $channelManager = $this->container->bound(ChannelManager::class)
18
            ? $this->container->make(ChannelManager::class)
19
            : null;
20
21
        return $channelManager && method_exists($channelManager, 'getRedisClient')
22
            ? $channelManager->getRedisClient()
23
            : parent::getConnection();
24
    }
25
}
26