Completed
Push — master ( abe8f5...f3c307 )
by Roman
02:17
created

StorageManager::createCacheDriver()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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