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/Component
Samuel ROZE d901c6d846 feature #28909 [Messenger] made dispatch() and handle() return void (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Messenger] made dispatch() and handle() return void

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

Middlewares and dispatchers should not return any value. Forwarding back the results from handlers breaks the scope of the component. The canonical example of some bad design this can lead to is `ChainHandler`: how can the caller know that there is one in the chain and that it should expect an array as a return value? More generally, how can a caller know what to expect back from a call to dispatch()? I think we should not allow such broken designs.

Instead, we should favor east-oriented design: if one needs a command bus, one would have to dispatch a proper command object - and if a result is expected back, it should be done via a setter on the dispatched command - or better, a callback set on the command object. This way we play *by the rules* of the type-system, not against.

Commits
-------

f942ffcb1b [Messenger] made dispatch() and handle() return void
2018-10-21 13:42:19 +01:00
..
Asset added different protocols to be allowed as asset base_urls 2018-09-16 22:06:58 +02:00
BrowserKit bug #28592 [BrowserKit] throw exception when request() wasn't called (xabbuh) 2018-09-29 23:52:52 +02:00
Cache [Cache] Fix outdated CHANGELOG line 2018-10-19 10:25:57 +02:00
Config Favor LogicException for missing classes & functions 2018-09-24 09:37:12 +02:00
Console Merge branch '4.1' 2018-10-14 13:50:41 -07:00
CssSelector Merge branch '4.1' 2018-10-02 18:38:08 +02:00
Debug Merge branch '4.1' 2018-10-02 18:38:08 +02:00
DependencyInjection Merge branch '4.1' 2018-10-10 06:54:27 -07:00
DomCrawler Merge branch '4.1' 2018-10-02 14:43:31 +02:00
Dotenv fixed typo in class name 2018-10-12 05:57:08 -07:00
EventDispatcher Merge branch '2.8' into 3.4 2018-10-11 06:05:17 -07:00
ExpressionLanguage Remove all usages of call_user_func_array() 2018-09-11 09:53:26 +02:00
Filesystem [Filesystem] Fix mirroring a directory with a relative path and a custom iterator 2018-10-10 04:36:40 -07:00
Finder [Finder] fix reverse sorting custom-ordering functions 2018-10-10 06:30:17 -07:00
Form minor #28916 [Form] Fix @method annotation (ro0NL) 2018-10-19 12:21:50 +02:00
HttpFoundation [HttpFoundation] Publicify new consts 2018-10-15 17:16:38 +02:00
HttpKernel [HttpKernel] Introduce KernelInterface::getProjectDir() 2018-10-17 11:36:49 +02:00
Inflector Merge branch '4.1' 2018-07-26 10:59:12 +02:00
Intl feature #28833 [Intl] Blacklist invalid languages (ro0NL) 2018-10-12 09:01:53 -07:00
Ldap Revamp LDAP options with nested definition 2018-10-12 11:49:15 -04:00
Lock Merge branch '4.1' 2018-10-10 06:54:27 -07:00
Messenger [Messenger] made dispatch() and handle() return void 2018-10-20 15:00:30 +02:00
OptionsResolver removed unneeded comments 2018-10-10 04:12:11 -07:00
Process Merge branch '4.1' 2018-10-14 13:50:41 -07:00
PropertyAccess Merge branch '4.1' 2018-10-02 14:43:31 +02:00
PropertyInfo Favor LogicException for missing classes & functions 2018-09-24 09:37:12 +02:00
Routing minor #28798 [Routing] simplify PhpMatcherDumper by splitting code logic from route data (nicolas-grekas) 2018-10-10 05:51:58 -07:00
Security Merge branch '4.1' 2018-10-10 16:58:57 +02:00
Serializer bug #28904 [Serializer] fix MetadataAwareNameConverter break denormalization (Britaliope) 2018-10-20 20:21:07 +02:00
Stopwatch Merge branch '4.1' 2018-10-02 14:43:31 +02:00
Templating Fix code examples in PHPDoc 2018-08-29 15:11:53 +02:00
Translation removed usage of sf2 when possible 2018-10-10 12:30:04 -07:00
Validator use constraint options instead of properties 2018-10-15 11:01:19 +02:00
VarDumper [VarDumper] Allow to use a light theme out of the box 2018-10-08 12:50:41 +02:00
VarExporter [VarExporter] add Instantiator::instantiate() to create+populate objects without calling their constructor nor any other methods 2018-09-18 17:22:26 +02:00
WebLink Merge branch '4.1' 2018-07-26 11:13:01 +02:00
Workflow Merge branch '4.1' 2018-10-02 14:43:31 +02:00
Yaml Merge branch '4.1' 2018-10-02 18:38:08 +02:00