/**
* Returns a header value by name.
*
- * @param string $key The header name
- * @param string|string[] $default The default value
- * @param bool $first Whether to return the first value or all header values
+ * @param string $key The header name
+ * @param string|string[]|null $default The default value
+ * @param bool $first Whether to return the first value or all header values
*
- * @return string|string[] The first header value or default value if $first is true, an array of values otherwise
+ * @return string|string[]|null The first header value or default value if $first is true, an array of values otherwise
*/
public function get($key, $default = null, $first = true)
{
*/
public function contains($key, $value)
{
- return in_array($value, $this->get($key, null, false));
+ return \in_array($value, $this->get($key, null, false));
}
/**
* @param string $key The parameter key
* @param \DateTime $default The default value
*
- * @return null|\DateTime The parsed DateTime or the default value if the header does not exist
+ * @return \DateTime|null The parsed DateTime or the default value if the header does not exist
*
* @throws \RuntimeException When the HTTP header is not parseable
*/
*/
public function count()
{
- return count($this->headers);
+ return \count($this->headers);
}
protected function getCacheControlHeader()