/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/Messenger/Message/RedispatchMessage.php
35 строк
1 KB
Grégoire Pineau
[Messenger] Use configured senders when RedispatchMessage has no transport name
06 авг 2026, 11:58
06 авг 2026, 11:58
b4a22d0
Код
Авторство
О чём код?
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Messenger\Message; use Symfony\Component\Messenger\Envelope; final class RedispatchMessage implements \Stringable { /** * @param object|Envelope $envelope The message or the message pre-wrapped in an envelope * @param string[]|string $transportNames Transport names to be used for the message, or an empty * array/string to use the senders configured for the message */ public function __construct( public readonly object $envelope, public readonly array|string $transportNames = [], ) { } public function __toString(): string { $message = $this->envelope instanceof Envelope ? $this->envelope->getMessage() : $this->envelope; return \sprintf('%s via %s', $message instanceof \Stringable ? (string) $message : $message::class, implode(', ', (array) $this->transportNames)); } }