1 | <?php |
||
24 | class MaxHeaderValueLengthFormatter implements TagHeaderFormatter |
||
25 | { |
||
26 | /** |
||
27 | * @var TagHeaderFormatter |
||
28 | */ |
||
29 | private $inner; |
||
30 | |||
31 | /** |
||
32 | * @var int |
||
33 | */ |
||
34 | private $maxHeaderValueLength; |
||
35 | |||
36 | /** |
||
37 | * The default value of the maximum header length is 4096 because most |
||
38 | * servers limit header values to 4kb. |
||
39 | * HTTP messages cannot carry characters outside the ISO-8859-1 standard so they all |
||
40 | * use up just one byte. |
||
41 | * |
||
42 | * @param TagHeaderFormatter $inner |
||
43 | * @param int $maxHeaderValueLength |
||
44 | */ |
||
45 | public function __construct(TagHeaderFormatter $inner, $maxHeaderValueLength = 4096) |
||
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | public function getTagsHeaderName() |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function getTagsHeaderValue(array $tags) |
||
86 | |||
87 | /** |
||
88 | * @param string $value |
||
89 | * |
||
90 | * @return bool |
||
91 | */ |
||
92 | private function isHeaderTooLong($value) |
||
96 | |||
97 | /** |
||
98 | * Split an array of tags in two more or less equal sized arrays. |
||
99 | * |
||
100 | * @param array $tags |
||
101 | * |
||
102 | * @return array |
||
103 | * |
||
104 | * @throws InvalidTagException |
||
105 | */ |
||
106 | private function splitTagsInHalves(array $tags) |
||
120 | } |
||
121 |