JanitorManager   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 3
eloc 6
c 1
b 1
f 0
dl 0
loc 36
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A createPassportDriver() 0 5 1
A getDefaultDriver() 0 3 1
A createJwtDriver() 0 5 1
1
<?php
2
3
namespace Signifly\Janitor;
4
5
use Illuminate\Support\Manager;
6
use InvalidArgumentException;
7
use Signifly\Janitor\Contracts\Factory;
8
9
class JanitorManager extends Manager implements Factory
10
{
11
    /**
12
     * Create an instance of the specified driver.
13
     *
14
     * @return \Signifly\Janitor\AbstractProxy
15
     */
16
    protected function createJwtDriver()
17
    {
18
        $config = $this->container['config']['janitor.drivers.jwt'];
19
20
        return new JWTProxy($config);
21
    }
22
23
    /**
24
     * Create an instance of the specified driver.
25
     *
26
     * @return \Signifly\Janitor\AbstractProxy
27
     */
28
    protected function createPassportDriver()
29
    {
30
        $config = $this->container['config']['janitor.drivers.passport'];
31
32
        return new PassportProxy($config);
33
    }
34
35
    /**
36
     * Get the default driver name.
37
     *
38
     * @throws \InvalidArgumentException
39
     *
40
     * @return string
41
     */
42
    public function getDefaultDriver()
43
    {
44
        throw new InvalidArgumentException('No Janitor driver was specified.');
45
    }
46
}
47