Set a directive.

This lets you overwrite a complex directive entirely (e.g. script-src)
or set a top-level directive (e.g. report-uri).

@param string $key
@param mixed $value

@return self
549078
public function setDirective(string $key, $value = []): self
    {
        $this->policies[$key] = $value;
        return $this;
    }
206146
public function add($key, $value): self
    {
        if (is_array($key)) {
            @ [$key, $value] = $key;
        }

        return $this->set($key, $value);
    }
506162
public function set($key, $value) {
        $this->_data[$this->_namespace][$key] = $value;
        return $this;
    }
1117248
public function setScriptAttribute(string $key, string $value)
    {
        $this->scriptAttributes[$key] = $value;

        return $this;
    }
1368217
public function setAttribute($key, $value = null)
    {
        if (is_array($key) && is_null($value)) {
            $this->attributes = $key;
        } else {
            array_set($this->attributes, $key, $value);
        }

        return $this;
    }
1109766
public function set($key, $value)
    {
        $parts = explode('.', $key);
        //loop through each part, create it if not present.
        $scope = &$this->array;
        $count = count($parts) - 1;
        for ($i = 0; $i < $count; $i++) {
            if (!isset($scope[$parts[$i]])) {
                $scope[$parts[$i]] = array();
            }
            $scope = &$scope[$parts[$i]];
        }
        $scope[$parts[$i]] = $value;

        return $this;
    }
1076593
public function setParameter($key, $value)
    {
        if (!$this->parameters) {
            $this->parameters = array();
        }

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

        return $this;
    }
1175722
public function set($key, $value)
	{
		$this->data[$key] = $this->close($value);

		return $this;
	}
1373323
public function set($key, $value) {
        if (!is_string($key)) throw new IllegalTypeException('Illegal type of parameter $key: '.gettype($key));
        $this->setProperty($key, $value);
        return $this;
    }
340551
public function set($key, $value)
        {
            $this->values[$this->normalizeKey($key)] = $value;

            return $this;
        }
637412
public static function set(string $key, $value)
    {
        return self::getViewHelper()->getView()->addValue($key, $value);
    }
177165
public function set($value, $key = null)
    {
        if (is_null($key)) {
            $this->registry[] = $value;
        } else {
            $this->registry[$key] = $value;
        }
        return $this;
    }
851222
public function set($key, $value = null)
    {
        $this->_email->setViewVars(is_string($key) ? [$key => $value] : $key);

        return $this;
    }
808088
public function setHypermedia(string $key, $value): self
    {
        $this->Hypermedia[$key] = $value;
        return $this;
    }
345353
public function set(string $key, $value) : Container
    {
        $this->items[$key] = $value;

        return $this;
    }
861634
public function set($key, $value)
    {
        $this->checkRestriction($value);

        if (!is_null($key)) {
            $this->value[$key] = $value;
        } else {
            $this->value[] = $value;
        }

        return $this;
    }
119938
public function set($key, $value = null) {
        if (strpos($key, '.') === false) {
            $this->_data[$key] = $value;
        } else {
            $this->_data = Hash::set($this->_data, $key, $value);
        }

        return $this;
    }