EventStorageServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 18 1
1
<?php namespace Nwidart\LaravelBroadway\Broadway;
2
3
use Illuminate\Support\ServiceProvider;
4
5
class EventStorageServiceProvider extends ServiceProvider
6
{
7
    public function register()
8
    {
9
        $this->app->bind(
10
            \Nwidart\LaravelBroadway\EventStore\EventStoreFactory::class,
11
            \Nwidart\LaravelBroadway\EventStore\Broadway\BroadwayEventStoreFactory::class
12
        );
13
14
        $this->app->bind(
15
            \Broadway\EventSourcing\AggregateFactory\AggregateFactory::class,
16
            \Broadway\EventSourcing\AggregateFactory\PublicConstructorAggregateFactory::class
17
        );
18
19
        $this->app->bind(\Broadway\EventStore\EventStore::class, function ($app) {
20
            $driver = $app['config']->get('broadway.event-store.driver');
21
22
            return $app[\Nwidart\LaravelBroadway\EventStore\EventStoreFactory::class]->make($driver)->getDriver();
23
        });
24
    }
25
}
26