OtpManager   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 24
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefaultDriver() 0 4 1
A createCacheDriver() 0 7 1
A createDatabaseDriver() 0 7 1
1
<?php
2
3
namespace Alish\LaravelOtp;
4
5
use Alish\LaravelOtp\Drivers\CacheDriver;
6
use Alish\LaravelOtp\Drivers\DatabaseDriver;
7
use Illuminate\Support\Manager;
8
9
class OtpManager extends Manager
10
{
11
12
    public function getDefaultDriver()
13
    {
14
        return 'cache';
15
    }
16
17
    public function createCacheDriver()
18
    {
19
        return new CacheDriver(
20
            $this->container->make('cache'),
21
            $this->container->make('hash'),
22
            $this->config->get('otp'));
23
    }
24
25
    public function createDatabaseDriver()
26
    {
27
        return new DatabaseDriver(
28
            $this->container->make('hash'),
29
            $this->config->get('otp')
30
        );
31
    }
32
}
33