8000 [Messenger] Add a middleware that wraps all handlers in one Doctrine transaction. by Nyholm · Pull Request #26647 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Messenger] Add a middleware that wraps all handlers in one Doctrine transaction. #26647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 24 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
cs
  • Loading branch information
Nyholm committed Mar 27, 2018
commit 5a6b8de3f5fff34672f9e69a1c42c3d6c4f0dba4
Original file line number Diff line number Diff line change
Expand Up @@ -967,11 +967,12 @@ private function addMessengerSection(ArrayNodeDefinition $rootNode)
->info('Messenger configuration')
->{!class_exists(FullStack::class) && class_exists(MessageBusInterface::class) ? 'canBeDisabled' : 'canBeEnabled'}()
->beforeNormalization()
->ifTrue(function($config) {
->ifTrue(function ($config) {
return empty($config['middlewares']);
})
->then(function($config) {
->then(function ($config) {
$config['middlewares'] = array();

return $config;
})
->end()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the proper way of making sure that there always is a config key named "middlewares"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it is not. We should of course use ->addDefaultsIfNotSet()

Expand Down
0