Completed
Push — master ( b112db...b25060 )
by Vladimir
10:13
created

FoundationServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 2
cts 3
cp 0.6667
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Foundation\Providers;
6
7
use FondBot\Foundation\Kernel;
8
use FondBot\Foundation\ServiceProvider;
9
use Illuminate\Contracts\Bus\Dispatcher;
10
use Illuminate\Contracts\Container\Container;
11
12
class FoundationServiceProvider extends ServiceProvider
13
{
14
    public function register(): void
15
    {
16 83
        $this->app->singleton(Kernel::class, function () {
17
            return new Kernel(resolve(Container::class), resolve(Dispatcher::class));
0 ignored issues
show
Unused Code introduced by
The call to Kernel::__construct() has too many arguments starting with resolve(\Illuminate\Cont...\Bus\Dispatcher::class).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
18 83
        });
19
    }
20
}
21