Skip to content

Commit 9791217

Browse files
committed
minor #11517 fix indention (OskarStark)
This PR was merged into the 4.2 branch. Discussion ---------- fix indention Follow up of #11506 but against `4.2` branch Commits ------- 3a8b3ab fix indention
2 parents c22a1c3 + 3a8b3ab commit 9791217

File tree

2 files changed

+50
-50
lines changed

2 files changed

+50
-50
lines changed

components/messenger.rst

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ that will do the required processing for your message::
111111

112112
class MyMessageHandler
113113
{
114-
public function __invoke(MyMessage $message)
115-
{
116-
// Message processing...
117-
}
114+
public function __invoke(MyMessage $message)
115+
{
116+
// Message processing...
117+
}
118118
}
119119

120120
Adding Metadata to Messages (Envelopes)
@@ -215,34 +215,34 @@ First, create your sender::
215215

216216
class ImportantActionToEmailSender implements SenderInterface
217217
{
218-
private $mailer;
219-
private $toEmail;
220-
221-
public function __construct(\Swift_Mailer $mailer, string $toEmail)
222-
{
223-
$this->mailer = $mailer;
224-
$this->toEmail = $toEmail;
225-
}
226-
227-
public function send(Envelope $envelope): Envelope
228-
{
229-
$message = $envelope->getMessage();
230-
231-
if (!$message instanceof ImportantAction) {
232-
throw new \InvalidArgumentException(sprintf('This transport only supports "%s" messages.', ImportantAction::class));
233-
}
234-
235-
$this->mailer->send(
236-
(new \Swift_Message('Important action made'))
237-
->setTo($this->toEmail)
238-
->setBody(
239-
'<h1>Important action</h1><p>Made by '.$message->getUsername().'</p>',
240-
'text/html'
241-
)
242-
);
243-
244-
return $envelope;
245-
}
218+
private $mailer;
219+
private $toEmail;
220+
221+
public function __construct(\Swift_Mailer $mailer, string $toEmail)
222+
{
223+
$this->mailer = $mailer;
224+
$this->toEmail = $toEmail;
225+
}
226+
227+
public function send(Envelope $envelope): Envelope
228+
{
229+
$message = $envelope->getMessage();
230+
231+
if (!$message instanceof ImportantAction) {
232+
throw new \InvalidArgumentException(sprintf('This transport only supports "%s" messages.', ImportantAction::class));
233+
}
234+
235+
$this->mailer->send(
236+
(new \Swift_Message('Important action made'))
237+
->setTo($this->toEmail)
238+
->setBody(
239+
'<h1>Important action</h1><p>Made by '.$message->getUsername().'</p>',
240+
'text/html'
241+
)
242+
);
243+
244+
return $envelope;
245+
}
246246
}
247247

248248
Your own Receiver
@@ -270,30 +270,30 @@ First, create your receiver::
270270

271271
class NewOrdersFromCsvFileReceiver implements ReceiverInterface
272272
{
273-
private $serializer;
274-
private $filePath;
273+
private $serializer;
274+
private $filePath;
275275

276-
public function __construct(SerializerInterface $serializer, string $filePath)
277-
{
276+
public function __construct(SerializerInterface $serializer, string $filePath)
277+
{
278278
$this->serializer = $serializer;
279279
$this->filePath = $filePath;
280-
}
280+
}
281281

282-
public function receive(callable $handler): void
283-
{
284-
$ordersFromCsv = $this->serializer->deserialize(file_get_contents($this->filePath), 'csv');
282+
public function receive(callable $handler): void
283+
{
284+
$ordersFromCsv = $this->serializer->deserialize(file_get_contents($this->filePath), 'csv');
285285

286-
foreach ($ordersFromCsv as $orderFromCsv) {
287-
$order = new NewOrder($orderFromCsv['id'], $orderFromCsv['account_id'], $orderFromCsv['amount']);
286+
foreach ($ordersFromCsv as $orderFromCsv) {
287+
$order = new NewOrder($orderFromCsv['id'], $orderFromCsv['account_id'], $orderFromCsv['amount']);
288288

289-
$handler(new Envelope($order));
290-
}
291-
}
289+
$handler(new Envelope($order));
290+
}
291+
}
292292

293-
public function stop(): void
294-
{
295-
// noop
296-
}
293+
public function stop(): void
294+
{
295+
// noop
296+
}
297297
}
298298

299299
Receiver and Sender on the same Bus

testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ Use the ``submitForm()`` method to submit the form that contains the given butto
716716
$client->request('GET', '/post/hello-world');
717717

718718
$crawler = $client->submitForm('Add comment', [
719-
'comment_form[content]' => '...',
719+
'comment_form[content]' => '...',
720720
]);
721721

722722
The first argument of ``submitForm()`` is the text content, ``id``, ``value`` or

0 commit comments

Comments
 (0)