Passed
Pull Request — master (#2)
by Alejandro
02:16
created

ServiceProvider::__construct()   A

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
0 ignored issues
show
Bug introduced by
The type Netflie\Componentes\Prov...cts\Container\Container was not found. Did you mean Illuminate\Contracts\Container\Container? If so, make sure to prefix the type with \.
Loading history...
12
     */
13
    protected $app;
14
15
    public function __construct(Container $app)
16
    {
17
        $this->app = $app;
0 ignored issues
show
Documentation Bug introduced by
It seems like $app of type Illuminate\Contracts\Container\Container is incompatible with the declared type Netflie\Componentes\Prov...cts\Container\Container of property $app.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
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
}