@param string|int $header

@return NodeElement
965715
public function findHeader($header)
    {
        $xpath = '/thead/tr/th'.(is_int($header) ? '['.$header.']' : '[contains(text(), "'.$header.'")]');

        \PHPUnit_Framework_Assert::assertNotNull(
            $node = $this->findGrid()->find('xpath', $xpath),
            sprintf('The grid header "%s" could not be found.', $header)
        );

        return $node;
    }
395005
public function getHeader($header)
    {
        if (array_key_exists($header, $this->responseHeaders)) {
            return $this->responseHeaders[$header];
        }
        // Do case-insensitive search
        foreach ($this->responseHeaders as $k => $v) {
            if (strtolower($k) == strtolower($header)) {
                return $v;
            }
        }
    }
1120795
public function setHeader($header)
    {
        foreach ($this->results as $name) {
            $this->columns->offsetGet($name)->setHeader($header);
        }

        return $this;
    }
1010385
public function setHeader($header = null)
    {
        if (is_null($header) && $this->getMethod() == "POST") {
            $host = $this->getHost();

            $header = [];
            $header[] = 'POST /cgi-bin/webscr HTTP/1.1';
            $header[] = 'Content-Type: application/x-www-form-urlencoded';
            if (isset($host)) {
                $header[] = 'Host: ' . $host;
            }
            $header[] = 'Connection: close';
        }
        $this->_aHeader = $header;
    }
488051
public function setContentTypeHeader(string $header)
    {
        if (Validation::isValidContentType($header)) {
            $this->contentTypeHeader = $header;
        } else {
            throw new CustomException('Invalid content type');
        }
    }
418612
public function withoutHeader($header)
    {
        if ($this->complete) {
            return $this;
        }

        $new = $this->psrResponse->withoutHeader($header);
        return new self($new);
    }
7972
function getHeader($header)
    {
        if (! $this->hasHeader($header)) {
            if (strtolower($header) === 'host'
                && ($this->uri && $this->uri->getHost())
            )
                return array($this->_getHostFromUri());

            return array();
        }

        $header = $this->_c_headerNormalized[strtolower($header)];
        $value  = $this->headers[$header];
        $value  = is_array($value) ? $value : array($value);
        return $value;
    }
671839
private function curlHeader($ch, $header) {
		$i = strpos ( $header, ':' );
		if (! empty ( $i )) {
			$key = str_replace ( '-', '_', strtolower ( substr ( $header, 0, $i ) ) );
			$value = trim ( substr ( $header, $i + 2 ) );
			$this->response ['headers'] [$key] = $value;
		}
		return strlen ( $header );
	}
827990
private function getBlockTextContent(AbstractBlock $header)
    {
        $text = '';
        foreach ($header->children() as $node) {
            $text .= $this->getNodeTextContent($node);
        }

        return $text;
    }
271365
private static function parseRangeHeader($header)
    {
        if (preg_match('/bytes=(?P<first>\d+)-(?P<last>\d+)?/', $header, $matches)) {
            return [
                (int) $matches['first'],
                isset($matches['last']) ? (int) $matches['last'] : null,
            ];
        }

        return false;
    }
419346
public function getOrderedElements($header)
    {
        if (!$header) {
            throw new InvalidArgument('The header string should not be empty.');
        }

        $elements = array();
        $orderKeys = array();
        foreach ($this->parseHeader($header) as $key => $h) {
            try {
                $element = $this->acceptFactory($h);
                $elements[] = $element;
                $orderKeys[] = [$element->getQuality(), $key, $element->getValue()];
            } catch (Exception\Exception $e) {
                // silently skip in case of invalid headers coming in from a client
            }
        }

        // sort based on quality and then original order. This is necessary as
        // to ensure that the first in the list for two items with the same
        // quality stays in that order in both PHP5 and PHP7.
        uasort($orderKeys, function ($a, $b) {
            $qA = $a[0];
            $qB = $b[0];

            if ($qA == $qB) {
                return $a[1] > $b[1];
            }

            return ($qA > $qB) ? -1 : 1;
        });

        $orderedElements = [];
        foreach ($orderKeys as $key) {
            $orderedElements[] = $elements[$key[1]];
        }

        return $orderedElements;
    }
288211
private function parseHeader($header)
    {
        $res = preg_match_all('/(?:[^,"]*+(?:"[^"]*+")?)+[^,"]*+/', $header, $matches);

        if (!$res) {
            throw new InvalidHeader(sprintf('Failed to parse accept header: "%s"', $header));
        }

        return array_values(array_filter(array_map('trim', $matches[0])));
    }
370503
function getHeaderField($header)
	{
		$header = strtoupper($header);

		if ($header == 'ACCEPT')
		{
			return $this->accepts;
		}

		$key = 'HTTP_' . strtoupper($header);

		if (isset($_SERVER[$key]))
		{
			return $SERVER[$key];
		}

		return null;
	}
291543
function renderHeader(&$header)
    {
        $this->_ary['sections'][$this->_sectionCount] = array(
            'header' => $header->toHtml(),
            'name'   => $header->getName()
        );
        $this->_currentSection = $this->_sectionCount++;
    }
91329
function add($header)
    {
        // convert to object form
        if (is_string($header))
            $header = HeaderField::fromString($header);

        $this->_headers[] = $header;
        return $this;
    }
293729
public function removeHeader($header)
	{
		if($header instanceof HttpHeaderInterface)
		{
			unset($this->headers[strtolower($header->getFieldName())]);
		}
		else
		{
			unset($this->headers[strtolower($header)]);
		}
		
		return $this;
	}
624686
private function getForwardedHeaderIp(string $header)
    {
        foreach (array_reverse(array_map('trim', explode(',', strtolower($header)))) as $values) {
            foreach (array_reverse(array_map('trim', explode(';', $values))) as $directive) {
                if (strpos($directive, 'for=') !== 0) {
                    continue;
                }

                $ip = trim(substr($directive, 4));

                if (self::isValid($ip) && !$this->isInProxiedIps($ip)) {
                    return $ip;
                }
            }
        }
    }