Cache   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 6 2
1
<?php
2
namespace PortlandLabs\Slackbot\Provider\Illuminate;
3
4
use Cache\Adapter\Filesystem\FilesystemCachePool;
5
use Illuminate\Container\Container;
6
use Psr\SimpleCache\CacheInterface;
7
8
class Cache implements Provider
9
{
10
11
    /**
12
     * Register this provider
13
     *
14
     * @param Container $container
15
     *
16
     * @return void
17
     */
18
    public function register(Container $container)
19
    {
20
        $cacheDir = getenv('CACHE_DIR') ?: 'cache';
21
22
        $container->singleton(CacheInterface::class, FilesystemCachePool::class);
23
        $container->when(FilesystemCachePool::class)->needs('$folder')->give($cacheDir);
24
    }
25
}