CommandServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 4
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 10 1
1
<?php namespace Nwidart\LaravelBroadway\Broadway;
2
3
use Broadway\CommandHandling\SimpleCommandBus;
4
use Illuminate\Support\ServiceProvider;
5
use Nwidart\LaravelBroadway\Registries\CommandRegistry;
6
7
class CommandServiceProvider extends ServiceProvider
8
{
9
    public function register()
10
    {
11
        $this->app->singleton(\Broadway\CommandHandling\CommandBus::class, function () {
12
            return new SimpleCommandBus();
13
        });
14
15
        $this->app->singleton('laravelbroadway.command.registry', function ($app) {
16
            return new CommandRegistry($app[\Broadway\CommandHandling\CommandBus::class]);
17
        });
18
    }
19
}
20