Dashboard sipadu mbip
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

PathHeader.php 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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\Mime\Header;
  11. use Symfony\Component\Mime\Address;
  12. use Symfony\Component\Mime\Exception\RfcComplianceException;
  13. /**
  14. * A Path Header, such a Return-Path (one address).
  15. *
  16. * @author Chris Corbyn
  17. *
  18. * @experimental in 4.3
  19. */
  20. final class PathHeader extends AbstractHeader
  21. {
  22. private $address;
  23. public function __construct(string $name, Address $address)
  24. {
  25. parent::__construct($name);
  26. $this->setAddress($address);
  27. }
  28. /**
  29. * @param Address $body
  30. *
  31. * @throws RfcComplianceException
  32. */
  33. public function setBody($body)
  34. {
  35. $this->setAddress($body);
  36. }
  37. /**
  38. * @return Address
  39. */
  40. public function getBody()
  41. {
  42. return $this->getAddress();
  43. }
  44. public function setAddress(Address $address)
  45. {
  46. $this->address = $address;
  47. }
  48. public function getAddress(): Address
  49. {
  50. return $this->address;
  51. }
  52. public function getBodyAsString(): string
  53. {
  54. return '<'.$this->address->toString().'>';
  55. }
  56. }