ServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
eloc 9
c 1
b 0
f 1
dl 0
loc 30
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 5 1
A __construct() 0 3 1
A registerViewProvider() 0 6 1
A registerEventProvider() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Netflie\Componentes\Provider;
4
5
use Illuminate\Contracts\Container\Container;
6
use Illuminate\Contracts\View\Factory as ViewFactoryContract;
7
8
class ServiceProvider
9
{
10
    /**
11
     * @var \Illuminate\Contracts\Container\Container
12
     */
13
    protected $app;
14
15
    public function __construct(Container $app)
16
    {
17
        $this->app = $app;
18
    }
19
20
    public function register()
21
    {
22
        $this->registerEventProvider();
23
24
        $this->registerViewProvider();
25
    }
26
27
    protected function registerEventProvider()
28
    {
29
        (new \Illuminate\Events\EventServiceProvider($this->app))->register();
30
    }
31
32
    protected function registerViewProvider()
33
    {
34
        (new ViewServiceProvider($this->app))->register();
35
36
        $this->app->bind(ViewFactoryContract::class, function ($app) {
37
            return $app['view'];
38
        });
39
    }
40
}