Sets a single value.

The value will be returned as is when requested with get().

@param string $key   The key, class or interface name.
@param mixed  $value The value to set.

@return Container
345353
public function set(string $key, $value) : Container
    {
        $this->items[$key] = $value;

        return $this;
    }
937953
public function set($key, $value = null)
    {
        if (func_num_args() === 1) {
            $key === '{}' && $key = json_decode('{}');
            $this->results = $key;
            return;
        }

        if ($value instanceof Closure) {
            $factory = $this->getFactory();
            $value($factory);
            $this->results[$key] = $factory->getResults();
            return $this;
        }

        $value === '{}' && $value = json_decode('{}');
        $this->results[$key] = $value;

        return $this;
    }
996373
public static function setVar($key, $value)
    {
        $var = new Vars($key);
        $var->key = $key;
        $var->value = $value;
        return $var->save();
    }
683427
public function set($key, $value)
    {
        array_set($this->config, $key, $value);
        $this->persist();

        return $this;
    }
665163
public function setAttribute($key, $value)
    {
        if ($this->hasSetMutator($key)) {
            $method = sprintf($this->methodNameSetMutator, Str::studly($key));

            return $this->{$method}($value);
        }

        $this->attributes[$key] = $value;

        return $this;
    }
1022058
public function assign($key, $value)
    {
        $templateVariableContainer = $this->baseRenderingContext->getTemplateVariableContainer();
        if ($templateVariableContainer->exists($key)) {
            $templateVariableContainer->remove($key);
        }
        $templateVariableContainer->add($key, $value);
        return $this;
    }
506162
public function set($key, $value) {
        $this->_data[$this->_namespace][$key] = $value;
        return $this;
    }
1323784
protected function setParameter($key, $value)
    {
        if (is_array($value) && isset($value['value'])) {
            $value = $value['value'];
        }

        $this->parameters->set($key, $value);

        return $this;
    }
186944
public function set(string $key, $value)
  {
    $keys = \explode('.',$key);
    $arr = &$this->confValues;
    $arrParent = null;

    # Walk the structure
    foreach ($keys as $key) {
      $arrParent = &$arr;
      $lastKey = $key;
      if (!isset($arr[$key])) {
        $arr[$key]=[];
      }
      $arr = &$arr[$key];
    }

    if (\is_null($value)) {
      unset($arrParent[$lastKey]); // delete the key
    } else {
      $arr = $value; // set the value in the original confArray
    }

    return $this;
  }
1029495
public function set($key, $value = null)
    {
        if ($value === null) {
            $this->parameters = $key + $this->parameters;
        } else {
            $this->parameters[$key] = $value;
        }

        return $this;
    }
1316827
public function set($key, $value)
    {
        $this->data[$key] = $value;
        $this->version++;
        
        return $this;
    }
971624
public function set($key, $value)
    {
        // If a child is an associative array or an stdClass we convert it as well
        if ((is_array($value) && (bool) count(array_filter(array_keys($value), 'is_string'))) || (is_object($value) && get_class($value) == 'stdClass')) {
            $value = new self($value);
        } elseif (is_array($value) && empty($value)) {
            $value = new self();
        }

        $this->data->$key = $value;
        return $this;
    }
771480
public function set($key, $value = null)
	{
		if (is_array($key))
		{
			foreach ($key as $arraykey => $value)
			{
				$this->set($arraykey, $value);
			}
		}
		else
		{
			if (isset($this->jar[$key]) and ! $this->jar[$key]->isDeleted())
			{
				if ($value instanceOf Cookie)
				{
					$this->jar[$key] = $value;
				}
				else
				{
					$this->jar[$key]->setValue($value);
				}
			}
			elseif ($this->has($key))
			{
				$this->parent->set($key, $value);
			}
			else
			{
				$this->jar[$key] = new Cookie($key, $this->config, $value);
			}
		}

		return $this;
	}
266080
public function set(string $key, $value): Option
    {
        $option = $this->repository->find($key);

        return $option->setValue($value);
    }
1185226
public function offsetSet($key, $value)
    {
        if (is_null($key)) {
            $this->values[] = $value;
        } else {
            $this->values[$key] = $value;
        }

        return $this;
    }
419861
public static function set(string $name, string $key, $value)
    {
        return static::getInstance($name)->set($key, $value);
    }
212341
function set($key, $value)
    {
        $p = &$this->__attainInternalPointer();
        $p[$key] = $value;
        return $this;
    }