EventStorageServiceProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 9.6666
c 0
b 0
f 0
cc 1
nc 1
nop 0
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