| 1 | <?php |
||
| 9 | final class OptimalEncodedHeaderValue |
||
| 10 | { |
||
| 11 | private const FOLDING = "\r\n "; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @var string |
||
| 15 | */ |
||
| 16 | private $encoded; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | private $encoding = '7bit'; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param string $value |
||
| 25 | * @param bool $phrase |
||
| 26 | */ |
||
| 27 | 147 | public function __construct(string $value, bool $phrase = false) |
|
| 54 | |||
| 55 | /** |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | 147 | public function __toString(): string |
|
| 62 | |||
| 63 | /** |
||
| 64 | * @return string |
||
| 65 | */ |
||
| 66 | 42 | public function getEncoding(): string |
|
| 70 | |||
| 71 | /** |
||
| 72 | * @param string $value |
||
| 73 | * @return OptimalEncodedHeaderValue |
||
| 74 | */ |
||
| 75 | 51 | public static function forPhrase(string $value): self |
|
| 79 | } |
||
| 80 |