CartServiceProvider::provides()   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 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Hideyo\Ecommerce\Framework\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
7
use Hideyo\Ecommerce\Framework\Services\Cart\Cart;
8
9
class CartServiceProvider extends ServiceProvider
10
{
11
12
    /**
13
     * Indicates if loading of the provider is deferred.
14
     *
15
     * @var bool
16
     */
17
    protected $defer = false;
18
19
20
    /**
21
     * Bootstrap the application services.
22
     *
23
     * @return void
24
     */
25
    public function boot()
26
    {
27
        //
28
    }
29
30
    /**
31
     * Register the application services.
32
     *
33
     * @return void
34
     */
35
    public function register()
36
    {
37
        $this->app->singleton('cart', function ($app) {
38
39
            $storage = $app['session'];
40
            $events = $app['events'];
41
            $instanceName = 'cart';
42
            $session_key = '88uuiioo11992888';
43
44
            return new Cart(
45
                $storage,
46
                $events,
47
                $instanceName,
48
                $session_key,
49
                config('cart')
50
            );
51
        });
52
    }
53
54
    /**
55
     * Get the services provided by the provider.
56
     *
57
     * @return array
58
     */
59
    public function provides()
60
    {
61
        return array('');
62
    }
63
}