SentStamp.php 988 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Messenger\Stamp;
  11. /**
  12. * Marker stamp identifying a message sent by the `SendMessageMiddleware`.
  13. *
  14. * @see \Symfony\Component\Messenger\Middleware\SendMessageMiddleware
  15. *
  16. * @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
  17. */
  18. final class SentStamp implements NonSendableStampInterface
  19. {
  20. private $senderClass;
  21. private $senderAlias;
  22. public function __construct(string $senderClass, string $senderAlias = null)
  23. {
  24. $this->senderAlias = $senderAlias;
  25. $this->senderClass = $senderClass;
  26. }
  27. public function getSenderClass(): string
  28. {
  29. return $this->senderClass;
  30. }
  31. public function getSenderAlias(): ?string
  32. {
  33. return $this->senderAlias;
  34. }
  35. }