ReadModelServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 13 1
1
<?php namespace Nwidart\LaravelBroadway\Broadway;
2
3
use Illuminate\Support\ServiceProvider;
4
5
class ReadModelServiceProvider extends ServiceProvider
6
{
7
    public function register()
8
    {
9
        $this->app->bind(
10
            \Nwidart\LaravelBroadway\ReadModel\ReadModelFactory::class,
11
            \Nwidart\LaravelBroadway\ReadModel\Broadway\BroadwayReadModelFactory::class
12
        );
13
14
        $driver = $this->app['config']->get('broadway.read-model');
15
16
        $this->app->singleton(ucfirst($driver), function ($app) use ($driver) {
17
            return $app[\Nwidart\LaravelBroadway\ReadModel\ReadModelFactory::class]->make($driver)->getDriver();
18
        });
19
    }
20
}
21