QueueDriver   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A __invoke() 0 4 1
1
<?php
2
3
/**
4
 * @author Jared King <[email protected]>
5
 *
6
 * @link http://jaredtking.com
7
 *
8
 * @copyright 2015 Jared King
9
 * @license MIT
10
 */
11
namespace Infuse\Services;
12
13
use Infuse\Queue;
14
15
class QueueDriver
16
{
17
    /**
18
     * @var \Infuse\Queue\Driver\DriverInterface
19
     */
20
    private $driver;
21
22
    public function __construct($app)
23
    {
24
        // set up the queue driver
25
        $class = $app['config']->get('queue.driver');
26
        $this->driver = new $class($app);
27
        Queue::setDriver($this->driver);
28
    }
29
30
    public function __invoke()
31
    {
32
        return $this->driver;
33
    }
34
}
35