AB
Size: a a a
AB
AM
В
$container->get($callable)
. Можно, конечно, ограничить только именами классов, но зачем, какой профит?DS
IS
AB
DS
AB
AB
SomeListener::
__construct(
Connection $connection);
[
'app.default-connection.some-listener' => [
'class' => SomeListener::class,
'connection' => Reference::
to('app.default-connection'),
],
'app.another-connection.some-listener' => [
'class' => SomeListener::class,
'connection' => Reference::
to('another.default-connection'),
],
]
DS
AB
DS
AB
DS
SomeEvent::class => [
function (ContainerInterface $container) {
$connection = $container->get(app.default-connection');
(new SomeListener($connection))();
}
]
AB
DS
В
AB
В
DS