Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UnstructuredHeader.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. /**
  12. * A Simple MIME Header.
  13. *
  14. * @author Chris Corbyn
  15. *
  16. * @experimental in 4.3
  17. */
  18. class UnstructuredHeader extends AbstractHeader
  19. {
  20. private $value;
  21. public function __construct(string $name, string $value)
  22. {
  23. parent::__construct($name);
  24. $this->setValue($value);
  25. }
  26. /**
  27. * @param string $body
  28. */
  29. public function setBody($body)
  30. {
  31. $this->setValue($body);
  32. }
  33. /**
  34. * @return string
  35. */
  36. public function getBody()
  37. {
  38. return $this->getValue();
  39. }
  40. /**
  41. * Get the (unencoded) value of this header.
  42. */
  43. public function getValue(): string
  44. {
  45. return $this->value;
  46. }
  47. /**
  48. * Set the (unencoded) value of this header.
  49. */
  50. public function setValue(string $value)
  51. {
  52. $this->value = $value;
  53. }
  54. /**
  55. * Get the value of this header prepared for rendering.
  56. */
  57. public function getBodyAsString(): string
  58. {
  59. return $this->encodeWords($this, $this->value);
  60. }
  61. }