@internal

@param string $name
@param mixed $value

@return self
199832
public function setAttr(string $name, $value): self {
        $this->collection()->each(function($node) use($name, $value) {
            if ($node instanceof \DOMElement) {
                $node->setAttribute($name, (string)$value);
            }
        });

        return $this;
    }
64884
public function addParam(string $name, $value): self
    {
        $this->parsedUri->queryString()->addParam($name, $value);
        return $this;
    }
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;
    }
357283
public function setRaw($name, $value = null)
    {
        if (is_array($name)) {
            foreach ($name as $innerName => $innerValue) {
                $this->replace($innerName, $innerValue);
            }
        } else {
            $this->replace($name, $value);
        }

        // return is for chaining
        return $this;
    }
164812
public static function create(string $name, string $value = null): self
    {
        return new self($name, $value);
    }
668093
public function withAddedHeader($name, $value) : self
    {
        $new = clone $this;

        return $new->setResponse($this->response->withAddedHeader($name, $value));
    }
379082
public function withHeader($name, $value)
    {
        $request = clone $this;
        $request->headers->set($name, $value);

        return $request;
    }
720072
public function implicit(string $name, $value): self
    {
        $this->data->implicit($name, $value);
        return $this;
    }
502710
public final function setHeader(string $name, ?string $value): self
    {
        if ($this->type == self::TYPE_REQUEST) {
            throw new HttpException('You cannot modify request headers');
        }

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

        return $this;
    }
269500
public function set(string $name, $value): self
    {
        $this->vars[$name] = $value;
        return $this;
    }
1239606
public function setEphemeral($name, $value)
    {
        $ephemeral                        = $this->get(self::EPHEMERAL);
        $ephemeral[$name][self::ACTIVE]   = true;
        $ephemeral[$name][self::VARIABLE] = $value;
        $this->set(self::EPHEMERAL, $ephemeral);

        return $this;
    }
922440
public function set($name, $value = null)
    {
        if (!is_array($name)) {
            $this->data[$name] = $value;
        } else {
            foreach ($name as $key => $value) {
                $this->data[$key] = $value;
            }
        }
        return $this;
    }
710722
public function setProperty($name, $value)
    {
        if (is_null($value)) {
            unset($this->_properties[$name]);
        } else {
            $this->_properties[$name] = $value;
        }
        return $this;
    }
531529
public function setAttribute($name, $value)
    {
        if (empty($value)) {
            $this->node->removeAttribute($name);
        } else {
            $this->node->setAttribute($name, $value);
        }

        return $this;
    }
1193453
public function setConfig(string $name, $value): self
    {
        $this->validateConfig($name)->config[$name] = $this->filterConfig($name, $value);
        return $this;
    }
220400
public function add(string $name, $value): self
    {
        $this->headers[$name] = $value;
        return $this;
    }
651246
public function withAddedHeader($name, $value): self
    {
        $request = clone $this;
        $request->headers->set($name, $value, false);

        return $request;
    }