application.services.php
1 year ago
command.bus.php
2 years ago
container.php
1 year ago
domain.event.bus.php
7 years ago
domain.services.php
2 years ago
infrastructure.services.php
1 year ago
infrastructure.user.php
7 years ago
repositories.php
2 years ago
request.php
1 year ago
domain.event.bus.php
20 lines
| 1 | <?php |
| 2 | defined('ABSPATH') or die('No script kiddies please!'); |
| 3 | |
| 4 | use AmeliaBooking\Infrastructure\Common\Container; |
| 5 | use League\Event\Emitter; |
| 6 | use AmeliaBooking\Domain\Events\DomainEventBus; |
| 7 | use AmeliaBooking\Infrastructure\WP\EventListeners\EventSubscribers; |
| 8 | |
| 9 | /** |
| 10 | * @param Container $c |
| 11 | * |
| 12 | * @return DomainEventBus |
| 13 | */ |
| 14 | $entries['domain.event.bus'] = function ($c) { |
| 15 | $eventBus = new DomainEventBus(new Emitter()); |
| 16 | // Subscribe the WP event listeners |
| 17 | EventSubscribers::subscribe($eventBus, $c); |
| 18 | return $eventBus; |
| 19 | }; |
| 20 |