Add a new item to collection.

@param string $name
@param mixed  $value

@return self
423820
public function put($name, $value)
    {
        if (is_object($value) && !$this->isValidObjectInstance($value)) {
            throw new InvalidCollectionItemInstanceException(sprintf('%s must implement %s', $name, $this->classname));
        }

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

        return $this->items[$name];
    }
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;
    }
185962
public function addAttribute($name, ...$value)
    {
        $value = is_array(array_get($value, 0, '')) ? array_get($value, 0) : $value;
        list($current_value, $separator) = $this->manipulateAttribute($name, $value);

        foreach ($value as $attribute_value) {
            $current_value[] = $attribute_value;
        }

        $this->updateAttribute($name, $current_value, $separator);

        return $this;
    }
630507
public function add($name, $value = null, $where = '')
    {
        if (!$this->has($name)) {
            $this->set($name, $value, $where);
        }

        return $this;
    }
15015
public function addHeaderIfNotExist(string $name, string $value) : self
    {
        $name = $this->normalizeHeader($name);
        if (isset($this->headers[$name])) {
            return $this;
        }

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

        return $this;
    }
824271
final public function setParameter(string $name, $value) : self
    {
        $this->parameters[$name] = $value;
        return $this;
    }
1271178
public function addHeader($name, $value)
    {
        $name = strtolower($name);
        $this->headers[$name] = $value;
        return $this;
    }
918161
public function extend($name, $value)
    {
        if (is_callable($value)) {
            $this->extensions[$name] = $value;
        } else {
            $this->extensions[$name] = function ($ontraport) use ($value) {
                return new $value($ontraport);
            };
        }

        return $this;
    }
1279569
public function set($name, $value)
    {
        $configuration = $this->configuration->getParameter('configuration');
        $configuration[$name] = $value;
        $this
            ->configuration
            ->setParameter(
                'configuration',
                $configuration
            );

        return $this;
    }
825228
public function withAttribute($name, $value)
    {
        $attributes = $this->getAttributes();
        if (array_key_exists($name, $attributes) && $attributes[$name] === $value) {
            return $this;
        }

        $attributes[$name] = $value;

        $newInstance = clone $this;
        $newInstance->setAttributes($attributes);
        return $newInstance;
    }
147768
public function set($name, $value)
    {
        Config::modify()->set($this->class, $name, $value);
        return $this;
    }
1218673
public function push($name, $value)
    {
        $previousValue = $this->get($name, []);

        $previousValue[] = $value;

        return $this->create($name, $previousValue);
    }
911387
public function set($name, $value)
    {
        if (is_array($value)) {
            $this->__options[$name] = $this->getInstance()->merge($value);
        } else {
            $this->__options[$name] = $value;
        }

        return $this;
    }
221739
public function append($name, $value)
    {
        if (is_array($this->_data[$name])) {
            $this->_data[$name][] = $value;
        } else {
            $this->_data[$name] .= $value;
        }

        return $this;
    }
743041
public function withProperty(string $name, $value): self
    {
        return new self(
            $this->object,
            $this->properties->put($name, $value),
            $this->injectionStrategy,
            $this->extractionStrategy
        );
    }
664652
public function addHeader( $name, $value )
	{
		$hs = $this->object->getHeaders();
		$hs->addTextHeader( $name, $value );
		return $this;
	}
1314324
public function add(string $name, string $value): HeaderCollection
    {
        $name = trim(strtolower($name));
        if (!array_key_exists($name, $this->headers)) {
            $this->headers[$name] = new Header($name);
        }
        $this->headers[$name]->addValue($value);
        return $this;
    }