ServiceProvider::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
nc 1
nop 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
}