| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
* This file is part of the Symfony package. |
| 5 |
* |
| 6 |
* (c) Fabien Potencier <[email protected]> |
| 7 |
* |
| 8 |
* For the full copyright and license information, please view the LICENSE |
| 9 |
* file that was distributed with this source code. |
| 10 |
*/ |
| 11 |
|
| 12 |
namespace Symfony\Component\Mime\Crypto; |
| 13 |
|
| 14 |
/** |
| 15 |
* A helper providing autocompletion for available DkimSigner options. |
| 16 |
* |
| 17 |
* @author Fabien Potencier <[email protected]> |
| 18 |
*/ |
| 19 |
final class DkimOptions |
| 20 |
{ |
| 21 |
private $options = []; |
| 22 |
|
| 23 |
public function toArray(): array |
| 24 |
{ |
| 25 |
return $this->options; |
| 26 |
} |
| 27 |
|
| 28 |
/** |
| 29 |
* @return $this |
| 30 |
*/ |
| 31 |
public function algorithm(string $algo): self |
| 32 |
{ |
| 33 |
$this->options['algorithm'] = $algo; |
| 34 |
|
| 35 |
return $this; |
| 36 |
} |
| 37 |
|
| 38 |
/** |
| 39 |
* @return $this |
| 40 |
*/ |
| 41 |
public function signatureExpirationDelay(int $show): self |
| 42 |
{ |
| 43 |
$this->options['signature_expiration_delay'] = $show; |
| 44 |
|
| 45 |
return $this; |
| 46 |
} |
| 47 |
|
| 48 |
/** |
| 49 |
* @return $this |
| 50 |
*/ |
| 51 |
public function bodyMaxLength(int $max): self |
| 52 |
{ |
| 53 |
$this->options['body_max_length'] = $max; |
| 54 |
|
| 55 |
return $this; |
| 56 |
} |
| 57 |
|
| 58 |
/** |
| 59 |
* @return $this |
| 60 |
*/ |
| 61 |
public function bodyShowLength(bool $show): self |
| 62 |
{ |
| 63 |
$this->options['body_show_length'] = $show; |
| 64 |
|
| 65 |
return $this; |
| 66 |
} |
| 67 |
|
| 68 |
/** |
| 69 |
* @return $this |
| 70 |
*/ |
| 71 |
public function headerCanon(string $canon): self |
| 72 |
{ |
| 73 |
$this->options['header_canon'] = $canon; |
| 74 |
|
| 75 |
return $this; |
| 76 |
} |
| 77 |
|
| 78 |
/** |
| 79 |
* @return $this |
| 80 |
*/ |
| 81 |
public function bodyCanon(string $canon): self |
| 82 |
{ |
| 83 |
$this->options['body_canon'] = $canon; |
| 84 |
|
| 85 |
return $this; |
| 86 |
} |
| 87 |
|
| 88 |
/** |
| 89 |
* @return $this |
| 90 |
*/ |
| 91 |
public function headersToIgnore(array $headers): self |
| 92 |
{ |
| 93 |
$this->options['headers_to_ignore'] = $headers; |
| 94 |
|
| 95 |
return $this; |
| 96 |
} |
| 97 |
} |
| 98 |
|