forked from broadway/broadway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BroadwayBundle.php
86 lines (80 loc) · 2.94 KB
/
BroadwayBundle.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
/*
* This file is part of the broadway/broadway package.
*
* (c) Qandidate.com <opensource@qandidate.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Broadway\Bundle\BroadwayBundle;
use Broadway\Bundle\BroadwayBundle\Command\SchemaEventStoreCreateCommand;
use Broadway\Bundle\BroadwayBundle\Command\SchemaEventStoreDropCommand;
use Broadway\Bundle\BroadwayBundle\DependencyInjection\DefineDBALEventStoreConnectionCompilerPass;
use Broadway\Bundle\BroadwayBundle\DependencyInjection\RegisterBusSubscribersCompilerPass;
use Broadway\Bundle\BroadwayBundle\DependencyInjection\RegisterEventListenerCompilerPass;
use Broadway\Bundle\BroadwayBundle\DependencyInjection\RegisterMetadataEnricherSubscriberPass;
use Broadway\Bundle\BroadwayBundle\DependencyInjection\RegisterSagaCompilerPass;
use Broadway\Bundle\BroadwayBundle\DependencyInjection\RegisterSerializersCompilerPass;
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* BroadwayBundle.
*/
class BroadwayBundle extends Bundle
{
/**
* {@inheritDoc}
*/
public function build(ContainerBuilder $container)
{
parent::build($container);
$container->addCompilerPass(
new RegisterSagaCompilerPass(
'broadway.saga.multiple_saga_manager',
'broadway.saga'
)
);
$container->addCompilerPass(
new RegisterBusSubscribersCompilerPass(
'broadway.command_handling.command_bus',
'command_handler',
'Broadway\CommandHandling\CommandHandlerInterface'
)
);
$container->addCompilerPass(
new RegisterBusSubscribersCompilerPass(
'broadway.event_handling.event_bus',
'broadway.domain.event_listener',
'Broadway\EventHandling\EventListenerInterface'
)
);
$container->addCompilerPass(
new RegisterEventListenerCompilerPass(
'broadway.event_dispatcher',
'broadway.event_listener'
)
);
$container->addCompilerPass(
new RegisterMetadataEnricherSubscriberPass(
'broadway.metadata_enriching_event_stream_decorator',
'broadway.metadata_enricher'
)
);
$container->addCompilerPass(
new DefineDBALEventStoreConnectionCompilerPass($this->getContainerExtension()->getAlias())
);
$container->addCompilerPass(
new RegisterSerializersCompilerPass()
);
}
/**
* {@inheritDoc}
*/
public function registerCommands(Application $application)
{
$application->add(new SchemaEventStoreCreateCommand());
$application->add(new SchemaEventStoreDropCommand());
}
}