Skip to content
This repository was archived by the owner on Aug 9, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ jobs:
symfony-version: # https://symfony.com/releases
- "6.4"
- "7.4"
- "8.1"
exclude:
# Symfony 8 requires PHP 8.4 or higher
- php-version: "8.2"
symfony-version: "8.1"
- php-version: "8.3"
symfony-version: "8.1"
steps:
- name: "Checkout"
uses: "actions/checkout@v7"
Expand Down
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
}
],
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.2",
"broadway/broadway": "^2.2.1",
"symfony/console": "^4.4 || ^5.3 || ^6.0 || ^7.0",
"symfony/http-kernel": "^4.4 || ^5.3 || ^6.0 || ^7.0"
"symfony/console": "^6.4 || ^7.4 || ^8.0",
"symfony/http-kernel": "^6.4 || ^7.4 || ^8.0"
},
"require-dev": {
"broadway/broadway-saga": "^1.0",
Expand All @@ -48,8 +48,7 @@
"monolog/monolog": "~2.0",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^11.5",
"symfony/framework-bundle": "^4.4 || ^5.3 || ^6.0 || ^7.0",
"symfony/proxy-manager-bridge": "^4.4 || ^5.3 || ^6.0",
"symfony/framework-bundle": "^6.4 || ^7.4 || ^8.0",
"phpstan/phpstan-symfony": "^2.0",
"friendsofphp/php-cs-fixer": "^3.0"
},
Expand Down
14 changes: 7 additions & 7 deletions src/DependencyInjection/BroadwayExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\ConfigurableExtension;

class BroadwayExtension extends ConfigurableExtension
{
protected function loadInternal(array $mergedConfig, ContainerBuilder $container): void
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
$loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.php');

if (isset($mergedConfig['event_store'])) {
$container->setParameter('broadway.event_store.service_id', $mergedConfig['event_store']);
Expand All @@ -39,7 +39,7 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container
$this->loadSerializers($mergedConfig['serializer'], $container, $loader);

if (isset($mergedConfig['saga']) && isset($mergedConfig['saga']['enabled']) && $mergedConfig['saga']['enabled']) {
$loader->load('saga.xml');
$loader->load('saga.php');

if (isset($mergedConfig['saga']['state_repository'])) {
$container->setParameter(
Expand All @@ -59,7 +59,7 @@ private function loadCommandBus(array $config, ContainerBuilder $container, Load
);

if ($logger = $config['logger']) {
$loader->load('auditing.xml');
$loader->load('auditing.php');
$container->setAlias('broadway.auditing.logger', new Alias($logger, true));
}
} else {
Expand All @@ -70,9 +70,9 @@ private function loadCommandBus(array $config, ContainerBuilder $container, Load
}
}

private function loadSerializers(array $config, ContainerBuilder $container, XmlFileLoader $loader): void
private function loadSerializers(array $config, ContainerBuilder $container, PhpFileLoader $loader): void
{
$loader->load('serializers.xml');
$loader->load('serializers.php');

foreach ($config as $serializer => $serviceId) {
$container->setParameter(sprintf('broadway.serializer.%s.service_id', $serializer), $serviceId);
Expand Down
37 changes: 37 additions & 0 deletions src/Resources/config/auditing.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

declare(strict_types=1);

/*
* This file is part of the broadway/broadway-bundle package.
*
* (c) 2020 Broadway project
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Broadway\Auditing\CommandLogger;
use Broadway\Auditing\NullByteCommandSerializer;

return static function (ContainerConfigurator $container): void {
$services = $container->services();

$services->set('broadway.auditing.command_logger', CommandLogger::class)
->args([
service('broadway.auditing.logger'),
service('broadway.auditing.serializer'),
])
->tag('broadway.event_listener', [
'event' => 'broadway.command_handling.command_success',
'method' => 'onCommandHandlingSuccess',
])
->tag('broadway.event_listener', [
'event' => 'broadway.command_handling.command_failure',
'method' => 'onCommandHandlingFailure',
]);

$services->set('broadway.auditing.serializer', NullByteCommandSerializer::class);
};
21 changes: 0 additions & 21 deletions src/Resources/config/auditing.xml

This file was deleted.

48 changes: 48 additions & 0 deletions src/Resources/config/saga.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

declare(strict_types=1);

/*
* This file is part of the broadway/broadway-bundle package.
*
* (c) 2020 Broadway project
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Broadway\Saga\Metadata\StaticallyConfiguredSagaMetadataFactory;
use Broadway\Saga\MultipleSagaManager;
use Broadway\Saga\SagaMetadataEnricher;
use Broadway\Saga\State\InMemoryRepository;
use Broadway\Saga\State\StateManager;

return static function (ContainerConfigurator $container): void {
$services = $container->services();

$services->set('broadway.saga.state.state_manager', StateManager::class)
->args([
service('broadway.saga.state.repository'),
service('broadway.uuid.generator'),
]);

$services->set('broadway.saga.metadata.factory', StaticallyConfiguredSagaMetadataFactory::class);

$services->set('broadway.saga.metadata_enricher', SagaMetadataEnricher::class)
->tag('broadway.event_listener', ['event' => 'broadway.saga.post_handle', 'method' => 'postHandleSaga'])
->tag('broadway.metadata_enricher');

$services->set('broadway.saga.multiple_saga_manager', MultipleSagaManager::class)
->args([
service('broadway.saga.state.repository'),
// will be populated by RegisterSagaCompilerPass:
[],
service('broadway.saga.state.state_manager'),
service('broadway.saga.metadata.factory'),
service('broadway.event_dispatcher'),
]);

$services->set('broadway.saga.state.in_memory_repository', InMemoryRepository::class);
};
32 changes: 0 additions & 32 deletions src/Resources/config/saga.xml

This file was deleted.

21 changes: 21 additions & 0 deletions src/Resources/config/serializers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

/*
* This file is part of the broadway/broadway-bundle package.
*
* (c) 2020 Broadway project
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Broadway\Serializer\SimpleInterfaceSerializer;

return static function (ContainerConfigurator $container): void {
$container->services()
->set('broadway.simple_interface_serializer', SimpleInterfaceSerializer::class);
};
11 changes: 0 additions & 11 deletions src/Resources/config/serializers.xml

This file was deleted.

56 changes: 56 additions & 0 deletions src/Resources/config/services.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

declare(strict_types=1);

/*
* This file is part of the broadway/broadway-bundle package.
*
* (c) 2020 Broadway project
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Broadway\Bundle\BroadwayBundle\Command\CommandMetadataEnricher;
use Broadway\CommandHandling\EventDispatchingCommandBus;
use Broadway\CommandHandling\SimpleCommandBus;
use Broadway\EventDispatcher\CallableEventDispatcher;
use Broadway\EventHandling\SimpleEventBus;
use Broadway\EventSourcing\MetadataEnrichment\MetadataEnrichingEventStreamDecorator;
use Broadway\EventStore\InMemoryEventStore;
use Broadway\ReadModel\InMemory\InMemoryRepositoryFactory;
use Broadway\UuidGenerator\Converter\BinaryUuidConverter;
use Broadway\UuidGenerator\Rfc4122\Version4Generator;

return static function (ContainerConfigurator $container): void {
$services = $container->services();

$services->set('broadway.command_handling.simple_command_bus', SimpleCommandBus::class);

$services->set('broadway.command_handling.event_dispatching_command_bus', EventDispatchingCommandBus::class)
->args([
service('broadway.command_handling.simple_command_bus'),
service('broadway.event_dispatcher'),
]);

$services->set('broadway.event_handling.event_bus', SimpleEventBus::class);

$services->set('broadway.uuid.converter', BinaryUuidConverter::class);

$services->set('broadway.uuid.generator', Version4Generator::class)
->public();

$services->set('broadway.metadata_enriching_event_stream_decorator', MetadataEnrichingEventStreamDecorator::class);

$services->set('broadway.metadata_enricher.console', CommandMetadataEnricher::class)
->tag('kernel.event_listener', ['event' => 'console.command', 'method' => 'handleConsoleCommandEvent'])
->tag('broadway.metadata_enricher');

$services->set('broadway.event_dispatcher', CallableEventDispatcher::class);

$services->set('broadway.event_store.in_memory', InMemoryEventStore::class);

$services->set('broadway.read_model.in_memory.repository_factory', InMemoryRepositoryFactory::class);
};
35 changes: 0 additions & 35 deletions src/Resources/config/services.xml

This file was deleted.