update patch 1
This commit is contained in:
+8
-12
@@ -24,21 +24,17 @@ use Symfony\Contracts\EventDispatcher\Event;
|
||||
*/
|
||||
final class MessageEvent extends Event
|
||||
{
|
||||
private RawMessage $message;
|
||||
private Envelope $envelope;
|
||||
private string $transport;
|
||||
private bool $queued;
|
||||
private bool $rejected = false;
|
||||
|
||||
/** @var StampInterface[] */
|
||||
private array $stamps = [];
|
||||
|
||||
public function __construct(RawMessage $message, Envelope $envelope, string $transport, bool $queued = false)
|
||||
{
|
||||
$this->message = $message;
|
||||
$this->envelope = $envelope;
|
||||
$this->transport = $transport;
|
||||
$this->queued = $queued;
|
||||
public function __construct(
|
||||
private RawMessage $message,
|
||||
private Envelope $envelope,
|
||||
private string $transport,
|
||||
private bool $queued = false,
|
||||
) {
|
||||
}
|
||||
|
||||
public function getMessage(): RawMessage
|
||||
@@ -85,7 +81,7 @@ final class MessageEvent extends Event
|
||||
public function addStamp(StampInterface $stamp): void
|
||||
{
|
||||
if (!$this->queued) {
|
||||
throw new LogicException(sprintf('Cannot call "%s()" on a message that is not meant to be queued.', __METHOD__));
|
||||
throw new LogicException(\sprintf('Cannot call "%s()" on a message that is not meant to be queued.', __METHOD__));
|
||||
}
|
||||
|
||||
$this->stamps[] = $stamp;
|
||||
@@ -97,7 +93,7 @@ final class MessageEvent extends Event
|
||||
public function getStamps(): array
|
||||
{
|
||||
if (!$this->queued) {
|
||||
throw new LogicException(sprintf('Cannot call "%s()" on a message that is not meant to be queued.', __METHOD__));
|
||||
throw new LogicException(\sprintf('Cannot call "%s()" on a message that is not meant to be queued.', __METHOD__));
|
||||
}
|
||||
|
||||
return $this->stamps;
|
||||
|
||||
Reference in New Issue
Block a user