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

IdentityManager   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 72.72%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 4
dl 0
loc 39
ccs 8
cts 11
cp 0.7272
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A createSessionDriver() 0 4 1
A createNopDriver() 0 4 1
A getDefaultDriver() 0 4 1
A setDefaultDriver() 0 4 1
A createAuthDriver() 0 4 1
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