HeaderInterface.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 MIME Header.
  13. *
  14. * @author Chris Corbyn
  15. */
  16. interface HeaderInterface
  17. {
  18. /**
  19. * Sets the body.
  20. *
  21. * The type depends on the Header concrete class.
  22. *
  23. * @param mixed $body
  24. */
  25. public function setBody($body);
  26. /**
  27. * Gets the body.
  28. *
  29. * The return type depends on the Header concrete class.
  30. *
  31. * @return mixed
  32. */
  33. public function getBody();
  34. public function setCharset(string $charset);
  35. public function getCharset(): ?string;
  36. public function setLanguage(string $lang);
  37. public function getLanguage(): ?string;
  38. public function getName(): string;
  39. public function setMaxLineLength(int $lineLength);
  40. public function getMaxLineLength(): int;
  41. /**
  42. * Gets this Header rendered as a compliant string.
  43. */
  44. public function toString(): string;
  45. /**
  46. * Gets the header's body, prepared for folding into a final header value.
  47. *
  48. * This is not necessarily RFC 2822 compliant since folding white space is
  49. * not added at this stage (see {@link toString()} for that).
  50. */
  51. public function getBodyAsString(): string;
  52. }