Completed
Push — stable ( 86ecc3...3a45ea )
by Nuno
07:34
created

CacheServiceProvider::getDefaultConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 11
ccs 2
cts 2
cp 1
rs 9.4285
cc 1
eloc 6
nc 1
nop 0
crap 1
1
<?php
2
3
/**
4
 * This file is part of Laravel Zero.
5
 *
6
 * (c) Nuno Maduro <[email protected]>
7
 *
8
 *  For the full copyright and license information, please view the LICENSE
9
 *  file that was distributed with this source code.
10
 */
11
12
namespace LaravelZero\Framework\Providers\Cache;
13
14
use Illuminate\Cache\CacheServiceProvider as BaseServiceProvider;
15
16
/**
17
 * This is the Laravel Zero Framework Cache Service Provider implementation.
18
 */
19
class CacheServiceProvider extends BaseServiceProvider
20
{
21
    /**
22
     * Register the Cache Service Provider.
23
     *
24
     * @return void
25
     */
26 21
    public function register(): void
27
    {
28 21
        parent::register();
29
30 21
        if ($this->app['config']->get('cache') === null) {
31 21
            $this->app['config']->set('cache', $this->getDefaultConfig());
32
        }
33 21
    }
34
35
    /**
36
     * Returns the default application cache config.
37
     *
38
     * We keep it simple using the `array` driver.
39
     *
40
     * @return array
41
     */
42 21
    protected function getDefaultConfig(): array
43
    {
44
        return [
45 21
            'default' => 'array',
46
            'stores' => [
47
                'array' => [
48
                    'driver' => 'array',
49
                ],
50
            ],
51
        ];
52
    }
53
}
54