This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony
Fabien Potencier 3abca64c5d feature #30707 [Messenger][DX] Allow stamps to be passed directly to MessageBusInterface::dispatch() (weaverryan)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger][DX] Allow stamps to be passed directly to MessageBusInterface::dispatch()

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | TODO

Me again o/!

This proposal is *purely* for DX. With `DelayStamp`, the proposal of QueueNameStamp and future things like `AmqpRoutingKeyStamp`, stamps are becoming more common for end users to use. This changes how it looks to use them:

```php
// before
$bus->dispatch(new Envelope(new SendSmsNotification('Hi!'), new DelayStamp(10), new QueueNameStamp('low')));

// after
$bus->dispatch(new SendSmsNotification('Hi!'), [new DelayStamp(10), new QueueNameStamp('low')]);
```

It's definitely a BC break, which is allowed because the component is experimental, though it should be minimized. This BC break shouldn't be felt by most end users, as creating your own bus is an advanced use-case. Even if you decorated it, you'll get an obvious error.

Commits
-------

e861de7e61 Allow stamps to be passed directly to MessageBusInterface::dispatch()
2019-03-31 18:29:02 +02:00
..
Bridge feature #30320 [Form][TwigBridge] Add row_attr to form theme (alexander-schranz) 2019-03-31 13:48:32 +02:00
Bundle Making the serializer configurable by transport 2019-03-31 16:54:31 +02:00
Component feature #30707 [Messenger][DX] Allow stamps to be passed directly to MessageBusInterface::dispatch() (weaverryan) 2019-03-31 18:29:02 +02:00
Contracts fixed typo 2019-03-31 15:49:16 +02:00