JanitorManager::getDefaultDriver()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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