StorageManager   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 2
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefaultDriver() 0 4 1
A createCacheDriver() 0 4 1
1
<?php
2
3
namespace Framgia\Jwt;
4
5
use Illuminate\Support\Manager;
6
use Framgia\Jwt\Storage\CacheStorage;
7
use Illuminate\Contracts\Cache\Repository as CacheRepository;
8
9
class StorageManager extends Manager
10
{
11
    /**
12
     * Get the default driver name.
13
     *
14
     * @return string
15
     */
16
    public function getDefaultDriver()
17
    {
18
        return $this->app['config']['jwt.storage.driver'];
19
    }
20
21
    /**
22
     * Create Cache storage driver.
23
     *
24
     * @return \Illuminate\Contracts\Cache\Repository
25
     */
26
    public function createCacheDriver()
27
    {
28
        return new CacheStorage($this->app[CacheRepository::class], $this->app['config']['jwt.storage.cache.tag']);
29
    }
30
}
31