Без опису

DkimOptions.php 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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\Crypto;
  11. /**
  12. * A helper providing autocompletion for available DkimSigner options.
  13. *
  14. * @author Fabien Potencier <fabien@symfony.com>
  15. */
  16. final class DkimOptions
  17. {
  18. private $options = [];
  19. public function toArray(): array
  20. {
  21. return $this->options;
  22. }
  23. /**
  24. * @return $this
  25. */
  26. public function algorithm(int $algo): self
  27. {
  28. $this->options['algorithm'] = $algo;
  29. return $this;
  30. }
  31. /**
  32. * @return $this
  33. */
  34. public function signatureExpirationDelay(int $show): self
  35. {
  36. $this->options['signature_expiration_delay'] = $show;
  37. return $this;
  38. }
  39. /**
  40. * @return $this
  41. */
  42. public function bodyMaxLength(int $max): self
  43. {
  44. $this->options['body_max_length'] = $max;
  45. return $this;
  46. }
  47. /**
  48. * @return $this
  49. */
  50. public function bodyShowLength(bool $show): self
  51. {
  52. $this->options['body_show_length'] = $show;
  53. return $this;
  54. }
  55. /**
  56. * @return $this
  57. */
  58. public function headerCanon(string $canon): self
  59. {
  60. $this->options['header_canon'] = $canon;
  61. return $this;
  62. }
  63. /**
  64. * @return $this
  65. */
  66. public function bodyCanon(string $canon): self
  67. {
  68. $this->options['body_canon'] = $canon;
  69. return $this;
  70. }
  71. /**
  72. * @return $this
  73. */
  74. public function headersToIgnore(array $headers): self
  75. {
  76. $this->options['headers_to_ignore'] = $headers;
  77. return $this;
  78. }
  79. }