暫無描述

HeaderInterface.php 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. }