ManagedCacheProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Codefocus\ManagedCache\Providers;
4
5
use Codefocus\ManagedCache\ManagedCache;
6
use Illuminate\Support\ServiceProvider;
7
8
class ManagedCacheProvider extends ServiceProvider
9
{
10
    /**
11
     * Indicates if loading of the provider is deferred.
12
     *
13
     * @var bool
14
     */
15
    protected $defer = false;
16
17
    protected $managedcache;
18
19
    /**
20
     * Constructor.
21
     *
22
     * @param ManagedCache $managedcache
23
     */
24
    public function boot(ManagedCache $managedcache)
25
    {
26
        $this->managedcache = $managedcache;
27
    }
28
29
    /**
30
     * Register bindings in the container.
31
     */
32
    public function register()
33
    {
34
        $this->app->singleton('codefocus.managedcache', function () {
35
            return $this->managedcache;
36
        });
37
    }
38
39
    /**
40
     * Get the services provided by the provider.
41
     *
42
     * @return array
43
     */
44
    public function provides()
45
    {
46
        return [
47
            ManagedCache::class,
48
        ];
49
    }
50
}
51