Skip to content
This repository was archived by the owner on Apr 20, 2018. It is now read-only.

Commit 92287c9

Browse files
committed
Merge pull request #2 from dirkluijk/patch-2
Added support for Symfony Event Dispatcher
2 parents 908772a + 4bc54c2 commit 92287c9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/Saxulum/Console/Provider/ConsoleProvider.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ public function register(Container $container)
3232

3333
$container['console'] = function () use ($container) {
3434
$console = new ConsoleApplication($container);
35+
36+
// automatically detect dispatcher (e.g. in Silex applications)
37+
if (isset($container['dispatcher']) && !is_null($container['dispatcher'])) {
38+
$console->setDispatcher($container['dispatcher']);
39+
}
40+
3541
foreach ($container['console.commands'] as $command) {
3642
$console->add($command);
3743
}

0 commit comments

Comments
 (0)