22
33namespace HelloFresh \Engine \EventSourcing ;
44
5- use Collections \Dictionary ;
5+ use Collections \Map ;
66use Collections \MapInterface ;
77use HelloFresh \Engine \EventBus \SimpleEventBus ;
88use HelloFresh \Engine \EventStore \Adapter \InMemoryAdapter ;
@@ -26,10 +26,10 @@ class AggregateRepositoryFactory implements AggregateRepositoryFactoryInterface
2626 public function __construct ($ config = null )
2727 {
2828 if (!$ config instanceof MapInterface) {
29- $ config = new Dictionary ($ config );
29+ $ config = new Map ($ config );
3030 }
3131
32- $ this ->config = new Dictionary ([
32+ $ this ->config = new Map ([
3333 'event_bus ' => [
3434 'service ' => new SimpleEventBus ()
3535 ],
@@ -74,7 +74,7 @@ public function build()
7474 private function configureEventStore (MapInterface $ config )
7575 {
7676 $ adapterName = $ config ->get ('adapter ' );
77- $ arguments = $ config ->tryGet ('arguments ' , []) ;
77+ $ arguments = $ config ->get ('arguments ' ) ? $ config -> get ( ' arguments ' ) : [] ;
7878
7979 $ adapter = new $ adapterName (...$ arguments );
8080
@@ -84,7 +84,7 @@ private function configureEventStore(MapInterface $config)
8484 private function configureSnapshotStore (MapInterface $ config )
8585 {
8686 $ adapterName = $ config ->get ('adapter ' );
87- $ arguments = $ config ->tryGet ('arguments ' , []) ;
87+ $ arguments = $ config ->get ('arguments ' ) ? $ config -> get ( ' arguments ' ) : [] ;
8888
8989 $ adapter = new $ adapterName (...$ arguments );
9090
@@ -94,7 +94,7 @@ private function configureSnapshotStore(MapInterface $config)
9494 private function configureSnapshotStrategy (MapInterface $ config )
9595 {
9696 $ adapterName = $ config ->get ('name ' );
97- $ arguments = $ config ->tryGet ('arguments ' , []) ;
97+ $ arguments = $ config ->get ('arguments ' ) ? $ config -> get ( ' arguments ' ) : [] ;
9898
9999 return new $ adapterName (...$ arguments );
100100 }
0 commit comments