ReceivedStamp.php 926 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. use Symfony\Component\Messenger\Middleware\SendMessageMiddleware;
  12. /**
  13. * Marker stamp for a received message.
  14. *
  15. * This is mainly used by the `SendMessageMiddleware` middleware to identify
  16. * a message should not be sent if it was just received.
  17. *
  18. * @see SendMessageMiddleware
  19. *
  20. * @author Samuel Roze <samuel.roze@gmail.com>
  21. */
  22. final class ReceivedStamp implements NonSendableStampInterface
  23. {
  24. private $transportName;
  25. public function __construct(string $transportName)
  26. {
  27. $this->transportName = $transportName;
  28. }
  29. public function getTransportName(): string
  30. {
  31. return $this->transportName;
  32. }
  33. }