Completed
Push — master ( afce1d...f8221d )
by Vladimir
09:37
created

Factory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 12 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Foundation;
6
7
use FondBot\Providers\DriverServiceProvider;
8
use Illuminate\Contracts\Foundation\Application;
9
10
class Factory
11
{
12
    public static function create(Application $application): Kernel
13
    {
14
        // Load service providers
15
        $application->register(DriverServiceProvider::class);
16
17
        // Boot kernel
18
        $kernel = Kernel::createInstance($application);
19
20
        $application->singleton(Kernel::class, $kernel);
0 ignored issues
show
Documentation introduced by
$kernel is of type object<FondBot\Foundation\Kernel>, but the function expects a object<Closure>|string|null.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
21
22
        return $kernel;
23
    }
24
}
25