ManagedCacheProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 40
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A provides() 0 4 1
A boot() 0 3 1
A register() 0 4 1
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