@@ -21,9 +21,6 @@ class HeaderBag implements \IteratorAggregate, \Countable
2121 protected $ headers = [];
2222 protected $ cacheControl = [];
2323
24- /**
25- * @param array $headers An array of HTTP headers
26- */
2724 public function __construct (array $ headers = [])
2825 {
2926 foreach ($ headers as $ key => $ values ) {
@@ -85,8 +82,6 @@ public function keys()
8582
8683 /**
8784 * Replaces the current HTTP headers by a new set.
88- *
89- * @param array $headers An array of HTTP headers
9085 */
9186 public function replace (array $ headers = [])
9287 {
@@ -96,8 +91,6 @@ public function replace(array $headers = [])
9691
9792 /**
9893 * Adds new headers the current HTTP headers set.
99- *
100- * @param array $headers An array of HTTP headers
10194 */
10295 public function add (array $ headers )
10396 {
@@ -109,9 +102,6 @@ public function add(array $headers)
109102 /**
110103 * Returns a header value by name.
111104 *
112- * @param string $key The header name
113- * @param string|null $default The default value
114- *
115105 * @return string|null The first header value or default value
116106 */
117107 public function get (string $ key , string $ default = null )
@@ -124,7 +114,6 @@ public function get(string $key, string $default = null)
124114 /**
125115 * Sets a header by name.
126116 *
127- * @param string $key The key
128117 * @param string|string[] $values The value or an array of values
129118 * @param bool $replace Whether to replace the actual value or not (true by default)
130119 */
@@ -156,8 +145,6 @@ public function set(string $key, $values, bool $replace = true)
156145 /**
157146 * Returns true if the HTTP header is defined.
158147 *
159- * @param string $key The HTTP header
160- *
161148 * @return bool true if the parameter exists, false otherwise
162149 */
163150 public function has (string $ key )
@@ -168,20 +155,15 @@ public function has(string $key)
168155 /**
169156 * Returns true if the given HTTP header contains the given value.
170157 *
171- * @param string $key The HTTP header name
172- * @param string $value The HTTP value
173- *
174158 * @return bool true if the value is contained in the header, false otherwise
175159 */
176160 public function contains (string $ key , string $ value )
177161 {
178- return \in_array ($ value , $ this ->all (( string ) $ key ));
162+ return \in_array ($ value , $ this ->all ($ key ));
179163 }
180164
181165 /**
182166 * Removes a header.
183- *
184- * @param string $key The HTTP header name
185167 */
186168 public function remove (string $ key )
187169 {
@@ -197,10 +179,7 @@ public function remove(string $key)
197179 /**
198180 * Returns the HTTP header value converted to a date.
199181 *
200- * @param string $key The parameter key
201- * @param \DateTime $default The default value
202- *
203- * @return \DateTime|null The parsed DateTime or the default value if the header does not exist
182+ * @return \DateTimeInterface|null The parsed DateTime or the default value if the header does not exist
204183 *
205184 * @throws \RuntimeException When the HTTP header is not parseable
206185 */
@@ -220,8 +199,7 @@ public function getDate(string $key, \DateTime $default = null)
220199 /**
221200 * Adds a custom Cache-Control directive.
222201 *
223- * @param string $key The Cache-Control directive name
224- * @param mixed $value The Cache-Control directive value
202+ * @param mixed $value The Cache-Control directive value
225203 */
226204 public function addCacheControlDirective (string $ key , $ value = true )
227205 {
@@ -233,8 +211,6 @@ public function addCacheControlDirective(string $key, $value = true)
233211 /**
234212 * Returns true if the Cache-Control directive is defined.
235213 *
236- * @param string $key The Cache-Control directive
237- *
238214 * @return bool true if the directive exists, false otherwise
239215 */
240216 public function hasCacheControlDirective (string $ key )
@@ -245,8 +221,6 @@ public function hasCacheControlDirective(string $key)
245221 /**
246222 * Returns a Cache-Control directive value by name.
247223 *
248- * @param string $key The directive name
249- *
250224 * @return mixed|null The directive value if defined, null otherwise
251225 */
252226 public function getCacheControlDirective (string $ key )
@@ -256,8 +230,6 @@ public function getCacheControlDirective(string $key)
256230
257231 /**
258232 * Removes a Cache-Control directive.
259- *
260- * @param string $key The Cache-Control directive
261233 */
262234 public function removeCacheControlDirective (string $ key )
263235 {
@@ -296,8 +268,6 @@ protected function getCacheControlHeader()
296268 /**
297269 * Parses a Cache-Control HTTP header.
298270 *
299- * @param string $header The value of the Cache-Control HTTP header
300- *
301271 * @return array An array representing the attribute values
302272 */
303273 protected function parseCacheControl (string $ header )
0 commit comments