Skip to content

Commit 69e8fc9

Browse files
committed
Simple way to locate services
1 parent 356b0e3 commit 69e8fc9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/Factory.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,10 @@ public static function create(
3636
$container->share(CommandBus::class, function () use ($container) {
3737
return self::createCommandBus($container);
3838
});
39-
array_map(
40-
[$container, 'share'],
41-
iterator_to_array(
42-
self::locateServices($container->get(EmitterInterface::class))
43-
)
44-
);
39+
40+
foreach (self::locateServices($container->get(EmitterInterface::class)) as $service) {
41+
$container->share($service);
42+
}
4543

4644
return new Client(
4745
$container

0 commit comments

Comments
 (0)