DatabaseConnector::connect()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 7
rs 10
1
<?php
2
3
namespace App\Queue\Connectors;
4
5
use App\Queue\DatabaseQueue;
6
7
class DatabaseConnector extends \Illuminate\Queue\Connectors\DatabaseConnector
8
{
9
    /**
10
     * Overrides default method to use my own DatabaseQueue.
11
     *
12
     * @param array $config
13
     *
14
     * @return DatabaseQueue|\Illuminate\Contracts\Queue\Queue
15
     */
16
    public function connect(array $config)
17
    {
18
        return new DatabaseQueue(
19
            $this->connections->connection($config['connection'] ?? null),
20
            $config['table'],
21
            $config['queue'],
22
            $config['retry_after'] ?? 60
23
        );
24
    }
25
}
26