From 9707b69c37e69a4874939736a8eb6e6c5a166688 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 2 Sep 2019 16:32:33 +0200 Subject: [PATCH] Move some doc contents in a Messenger article --- messenger/handler_results.rst | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/messenger/handler_results.rst b/messenger/handler_results.rst index 08a244d5e32..dc4c1fd0821 100644 --- a/messenger/handler_results.rst +++ b/messenger/handler_results.rst @@ -20,11 +20,6 @@ You can use this to get the value returned by the handler(s):: // or get info about all of handlers $handledStamps = $envelope->all(HandledStamp::class); -A :class:`Symfony\\Component\\Messenger\\HandleTrait` also exists in order to ease -leveraging a Messenger bus for synchronous needs. -The :method:`Symfony\\Component\\Messenger\\HandleTrait::handle` method ensures -there is exactly one handler registered and returns its result. - Working with Command & Query Buses ---------------------------------- @@ -36,8 +31,10 @@ buses are central pieces of the application. Read Martin Fowler's As queries are usually synchronous and expected to be handled once, getting the result from the handler is a common need. -To avoid boilerplate code, you can leverage the ``HandleTrait`` in any class -that has a ``$messageBus`` property:: +A :class:`Symfony\\Component\\Messenger\\HandleTrait` exists to get the result +of the handler when processing synchronously. It also ensures that exactly one +handler is registered. The ``HandleTrait`` can be used in any class that has a +``$messageBus`` property:: // src/Action/ListItems.php namespace App\Action;