Initializes and returns a new ReceivedDomainPart.

@param string $name
@param string $value
@param string $ehloName
@param string $hostName
@param string $hostAddress
@return \ZBateson\MailMimeParser\Header\Part\ReceivedDomainPart
320288
public function newReceivedDomainPart(
        $name,
        $value,
        $ehloName = null,
        $hostName = null,
        $hostAddress = null
    ) {
        return new ReceivedDomainPart(
            $this->charsetConverter,
            $name,
            $value,
            $ehloName,
            $hostName,
            $hostAddress
        );
    }
1023960
protected function setHeader($name, $value)
    {
        if (! is_array($value)) {
            $value = [$value];
        }
        $this->headers[$name] = $value;
        $this->headerKeys[strtolower($name)] = $name;
    }
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;
    }
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;
    }
1217330
public function header($name, $value = null)
    {

        if ($value === null) {
            $this->headers[] = $name;
        } else {
            $this->headers[] = $this->headerString($name, $value);
        }

        return $this;
    }
343393
public function addHeaderIfNotExist(string $name, string $value) : parent
    {
        if ($this->headerSent($file, $line)) {
            throw new \LogicException(sprintf("Headers is already sent in '%s:%s'", $file, $line));
        }

        return parent::addHeaderIfNotExist($name, $value);
    }
538224
static public function url($name, $value=null, $settings=[])
    {
        $settings['media_type'] = 'url';
        $settings['with_input'] = isset($settings['with_input']) ? $settings['with_input'] : 'text';
        return static::select($name, $value, $settings);
    }
1199814
public function thereIsTheARecordForDomainWithTheValue(string $name, string $domain, string $value): void
    {
        $this->adapter->existingRecords = array_merge(
            $this->adapter->existingRecords,
            [new Record($name, $domain, Record::TYPE_ADDRESS, $value)]
        );
    }
1093011
public function withAddedHeader($name, $value)
    {
        $instance = clone $this;
        $instance->headers->add($name, $value);
        return $instance;
    }
664652
public function addHeader( $name, $value )
	{
		$hs = $this->object->getHeaders();
		$hs->addTextHeader( $name, $value );
		return $this;
	}
603320
public function createParameterizedHeader($name, $value = null, $params = [])
    {
        $header = new Swift_Mime_Headers_ParameterizedHeader($name, $this->encoder, ('content-disposition' == strtolower($name)) ? $this->paramEncoder : null);
        if (isset($value)) {
            $header->setFieldBodyModel($value);
        }
        foreach ($params as $k => $v) {
            $header->setParameter($k, $v);
        }
        $this->setHeaderCharset($header);

        return $header;
    }
238412
public function sendHeader(string $name, ?string $value): void
    {
        if (headers_sent($file, $line)) {
            throw new HttpException(sprintf("Cannot use '%s()', headers already sent in %s:%s",
                __method__, $file, $line));
        }

        // null means remove
        if ($value === null) {
            $this->removeHeader($name);
            header_remove($name);
        } else {
            $this->setHeader($name, $value);
            header(sprintf('%s: %s', $name, $value));
        }
    }
852729
public function setHeaders($name, $value = null)
	{
		//Verifying if is array
		if (is_array($name)) {
			foreach ($name as $k => $v) {
				if (is_string($k)) {
					$this->setHeaders($k, $v);
				} else {
					$this->setHeaders($v, null);
				}
			}
		} else {
			// Verifying if is a string without $value parameter
			if (is_null($value) && (strpos($name, ':') > 0)) {
				list($name, $value) = explode(':', $name, 2);
			}
			
			if (is_null($value) || $value === false) {
				unset($this->headers[$name]);
			} else {
				if (is_string($value)) {
					$value = trim($value);
				}
				$this->headers[$name] = $value;
			}
		}
		
		return $this;
	}
865785
public final function header(string $name, string $value = null)
    {
        return ($value === null) ? $this->getHeader($name) : $this->setHeader($name, $value);
    }
1175928
public final function setHeader($name, $value)
    {
        self::checkString($name);
        self::checkString($value);

        $this->_headers[$name] = $value;
    }
664213
public function addParam($name, $value, $convertToArrayIfExists = false)
    {
        if (isset($this->components[self::QUERY][$name])) {
            if (!is_array($this->components[self::QUERY][$name])) {
                if ($convertToArrayIfExists) {
                    $this->components[self::QUERY][$name] = [$this->components[self::QUERY][$name]];
                } else {
                    throw new \InvalidArgumentException("$name is not an array");
                }
            }
        } else {
            $this->components[self::QUERY][$name] = [];
        }
        $this->components[self::QUERY][$name][] = $value;
        return $this;
    }
728508
public function addHeader(string $name, string $value): Response
    {
        $this->headers->add($name, $value);
        return $this;
    }