Completed
Branch stable (378b09)
by Nuno
04:07 queued 02:17
created

ServiceProvider::getDefaultConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace LaravelZero\Framework\Providers\Cache;
4
5
use Illuminate\Cache\CacheServiceProvider as BaseServiceProvider;
6
7
/**
8
 * This is the Laravel Zero Framework Filesystem service provider class.
9
 *
10
 * @author Nuno Maduro <[email protected]>
11
 */
12
class ServiceProvider extends BaseServiceProvider
13
{
14
    /**
15
     * Register Scheduler service.
16
     *
17
     * @return void
18
     */
19
    public function register(): void
20
    {
21
        parent::register();
22
23
        $config = $this->app->make('config');
24
25
        if ($config->get('cache') === null) {
26
            $config->set('cache', $this->getDefaultConfig());
27
        }
28
    }
29
30
    /**
31
     * Returns the default application cache config.
32
     *
33
     * In order to keep it simple we use the `array` driver. Feel free
34
     * to use another driver, be sure to check the cache component
35
     * documentation.
36
     *
37
     * @return array
38
     */
39
    protected function getDefaultConfig(): array
40
    {
41
        return [
42
            'default' => 'array',
43
            'stores' => [
44
                'array' => [
45
                    'driver' => 'array',
46
                ],
47
            ],
48
        ];
49
    }
50
}
51