设置header
@param AbstractMessage $object
@param string $name
@param string $value
@return static
334614
protected function setHeader($object, $name, $value)
    {
        $lowerName = strtolower($name);
        if(isset($object->headerNames[$lowerName]))
        {
            $name = $object->headerNames[$lowerName];
        }
        else
        {
            $object->headerNames[$lowerName] = $name;
        }
        if(is_string($value))
        {
            $object->headers[$name] = [$value];
        }
        else if(is_array($value))
        {
            $object->headers[$name] = $value;
        }
        else
        {
            throw new \InvalidArgumentException('invalid header names or values');
        }
        return $object;
    }
60044
public function createTextHeader($name, $value = null)
    {
        $header = new Swift_Mime_Headers_UnstructuredHeader($name, $this->encoder);
        if (isset($value)) {
            $header->setFieldBodyModel($value);
        }
        $this->setHeaderCharset($header);

        return $header;
    }
1201645
public function setHeader($name, $value)
    {
        $internalName = strtolower($name);

        if (true === is_array($value)) {
            $this->headers[$internalName] = $value;
        } else {
            $this->headers[$internalName] = array($value);
        }
    }
681839
protected function _sendHeader($name, $value = null)
    {
        deprecationWarning(
            'Will be removed in 4.0.0'
        );

        if ($value === null) {
            header($name);
        } else {
            header("{$name}: {$value}");
        }
    }
173766
public function setHeader(string $name, $value) : Message
    {
        $name = strtolower($name);
        $this->headers[$name] = is_array($value) ? array_values($value) : [$value];

        return $this;
    }
1245864
public function withHeader($name, $value)
    {
        if (array_key_exists($name, $this->headers) && in_array($value, $this->headers[$name])) {
            return $this;
        }

        $instance = clone $this;
        $instance->headers[$name] = array_filter((array)$value);
        return $instance;
    }
1059876
public function addDefaultResponseHeader(string $name, string $value) : AbstractStrategy
    {
        $this->defaultResponseHeaders[strtolower($name)] = $value;

        return $this;
    }
1349825
protected function addHeader(string $name, string $value) : self
    {
        $this->headers[$name] = $value;

        return $this;
    }
1006360
public function addHeader($name, $value, $params = null)
    {
        if (is_array($params)) {
            $this->message->getHeaders()->addParameterizedHeader($name, $value, $params);
        } else {
            $this->message->getHeaders()->addTextHeader($name, $value);
        }

        return $this;
    }
488912
public function AddCustomHeader($name, $value=null) {
	if ($value === null) {
		// Value passed in as name:value
		$this->CustomHeader[] = explode(':', $name, 2);
	} else {
		$this->CustomHeader[] = array($name, $value);
	}
  }
1344070
final public function withHeader($name, $value): self
    {
        $message = clone $this;

        //Make sure to remove the current header with the same
        //name to avoid casing-duplication (location, Location, LOCATION)
        if ($message->hasHeader($name)) {
            $message = $message->withoutHeader($name);
        }

        $message->addHeaders([$name => $value]);
        return $message;
    }
616715
public function setRequestHeader($name, $value)
    {
        if (!is_string($name))
            throw new \InvalidArgumentException('Argument 1 expected to be string, '.gettype($name).' seen.');

        if (!is_string($value))
            throw new \InvalidArgumentException('Argument 2 expected to be string, '.gettype($value).' seen.');

        if (($name = trim($name)) === '')
            throw new \RuntimeException('Argument 1 cannot be empty string.');

        $this->requestHeaders[$name] = $value;

        return $this;
    }
110058
public function addHeader(string $name, $value) : Message
    {
        $name = strtolower($name);

        if (is_array($value)) {
            $value = array_values($value);
            $this->headers[$name] = isset($this->headers[$name])
                ? array_merge($this->headers[$name], $value)
                : $value;
        } else {
            $this->headers[$name][] = $value;
        }

        return $this;
    }
1212765
protected function setObjectProperty($object, $name, $value)
    {
        if (ClassInfo::hasMethod($object, 'set' . $name)) {
            $object->{'set' . $name}($value);
        } else {
            $object->$name = $value;
        }
    }
814033
public function addHeader($name, $value)
    {
        if (isset($this->headers[$name])) {
            if (is_array($this->headers[$name])) {
                $this->headers[$name][] = $value;
            } else {
                $this->headers[$name] = $value;
            }
        } else {
            $this->headers[$name] = [$value];
        }

        return $this;
    }
184617
public function make(string $name = null, string $value = null): \BearFramework\App\Response\Header
    {
        if ($this->newHeaderCache === null) {
            $this->newHeaderCache = new \BearFramework\App\Response\Header();
        }
        $object = clone($this->newHeaderCache);
        if ($name !== null) {
            $object->name = $name;
        }
        if ($value !== null) {
            $object->value = $value;
        }
        return $object;
    }
936837
public function addHeader($name, $value, $params = null)
    {
        $this->message->addHeader($name, $value);

        return $this;
    }