Passed
Push — master ( 6248da...8ce640 )
by László
02:40
created

IdentityManager::setDefaultDriver()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
nc 1
cc 1
nop 1
crap 2
1
<?php
2
3
namespace CodingSocks\UploadHandler;
4
5
use CodingSocks\UploadHandler\Identifier\AuthIdentifier;
6
use CodingSocks\UploadHandler\Identifier\NopIdentifier;
7
use CodingSocks\UploadHandler\Identifier\SessionIdentifier;
8
use Illuminate\Support\Manager;
9
10
class IdentityManager extends Manager
11
{
12 8
    public function createSessionDriver()
13
    {
14 8
        return new SessionIdentifier();
15
    }
16
17 1
    public function createAuthDriver()
18
    {
19 1
        return new AuthIdentifier();
20
    }
21
22 128
    public function createNopDriver()
23
    {
24 128
        return new NopIdentifier();
25
    }
26
27
    /**
28
     * Get the default driver name.
29
     *
30
     * @return string
31
     */
32 134
    public function getDefaultDriver()
33
    {
34 134
        return $this->container['config']['upload-handler.identifier'];
35
    }
36
37
    /**
38
     * Set the default mail driver name.
39
     *
40
     * @param  string $name
41
     *
42
     * @return void
43
     */
44
    public function setDefaultDriver($name)
45
    {
46
        $this->container['config']['upload-handler.identifier'] = $name;
47
    }
48
}
49