Sets value of an option.

@param Parameter   $parameter
@param string|null $value

@return bool Indicating whether it has eaten adjoining arg to its right.
506538
protected function setValue(Parameter $parameter, string $value = null): bool
    {
        $name  = $parameter->attributeName();
        $value = $this->_normalizer->normalizeValue($parameter, $value);

        return $this->set($name, $value, $parameter->variadic());
    }
171456
protected function _validate_ext($value, $parameter)
    {
        if ($value === '') {
            return '';
        }

        $ext = pathinfo($value, PATHINFO_EXTENSION);
        return in_array(strtolower($ext), preg_split('#[\s,]+#', $parameter, -1, PREG_SPLIT_NO_EMPTY), true) ? $value : null;
    }
1029495
public function set($key, $value = null)
    {
        if ($value === null) {
            $this->parameters = $key + $this->parameters;
        } else {
            $this->parameters[$key] = $value;
        }

        return $this;
    }
1321986
public function parameter($key, $value = NULL)
	{
		if (func_num_args() === 1)
		{
			if ( ! array_key_exists($key, $this->_parameters))
			{
				throw new \InvalidArgumentException('Parameter not set: '.$key);
			}
			return $this->_parameters[$key];
		}
		$this->_parameters[$key] = $value;
		return $this;
	}
1242601
public function setParam($key, $value)
        {
            $key = (string) $key;

            if ((null === $value) && isset($this->_params[$key])) {
                unset($this->_params[$key]);
            } elseif (null !== $value) {
                $this->_params[$key] = $value;
            }

            return $this;
        }
558351
public function validateNotNullOrEmpty($parameter, $value)
    {
        $this->validateNotNull($parameter, $value);

        $this->validateNotEmpty($parameter, $value);

        return true;
    }
1114866
public function setStringValue($value = null)
    {
        if ($value !== null && ! $value instanceof \Protobuf\Stream) {
            $value = \Protobuf\Stream::wrap($value);
        }

        $this->string_value = $value;
    }
755047
public function addOption($option, $value = null)
    {
        if (is_array($option)) {
            $this->options = $option + $this->options;
        } else {
            $this->options[$option] = $value;
        }
    }
1064598
protected function sget($parameter, $value=null) {
		return $value === null ? $this->get($parameter) : $this->set($parameter, $value);
	}
1333482
public function setParameter(string $parameter, string $value): self
    {
        $this->parameters[$parameter] = $value;

        return $this;
    }
488794
public static function set($option, $value)
    {
        if (!array_key_exists($option, self::$conf))
        {
            throw new InvalidArgumentException(sprintf('Unknown option "%s"', $option));
        }

        $expected = gettype(self::$conf[$option]);
        $actual = gettype($value);
        if ($expected != $actual)
        {
            throw new InvalidArgumentException(
                sprintf('Option "%s" has type "%s", but "%s" given',
                    $option, $expected, $actual)
            );
        }

        self::$conf[$option] = $value;
    }
1166733
public function setParam($param, $value = null) {
		if (!empty($this->_stub['iframe-player']) && $this->config['prefer'] === 'iframe') {
			if (is_array($param)) {
				foreach ($param as $p => $v) {
					$this->_iframeParams[$p] = $v;
				}

			} else {
				$this->_iframeParams[$param] = $value;
			}
		} else {
			if (is_array($param)) {
				foreach ($param as $p => $v) {
					$this->_objectParams[$p] = $v;
				}

			} else {
				$this->_objectParams[$param] = $value;
			}
		}
		return $this;
	}
567220
def set_parameters(self, parameter, value):
        
        if parameter == 'lo':
            self.parameters['lo'] = 1 / value
        else:
            self.parameters[parameter] = value
574570
public function setParameter( $parameter, $value, $restorePoint = self::PREVIOUS, $type = self::SESSION )
    {

        if (!is_scalar($value)) {
            throw new BadTypeException($value, 'scalar');
        }

        self::isParameterAllowed( $parameter );
        if( !in_array( $type, array( self::SESSION, self::LOCAL ) ) ) {
            throw new \InvalidArgumentException("WTF!");
        }

        if( $restorePoint and !is_scalar($restorePoint) ) {
            throw new \InvalidArgumentException( "RestorePoint has to be a scalar.");
        }

        // manage previous and original stores
        $currentValue = $this->getParameter( $parameter );

        if( !isset( $this->parameterStore[$parameter][self::ORIGINAL] ) ) {
            $this->parameterStore[$parameter][self::ORIGINAL] = $currentValue;
        }

        $this->parameterStore[$parameter][self::PREVIOUS] = $currentValue;

        // we can't quote a parameter value so regex
        /*
        if( preg_match_all('/[^a-zA-Z0-9_]/', $value, $matches ) ) {
            $badChars = implode('', $matches[0]);
            throw new \Exception( "We can't quote parameter values. Bad characters `{$badChars}`" );
        }
         */

        // bool
        if( $value === true ) {
            $value = 'true';
        } elseif( $value === false ) {
            $value = 'false';
        }

        // parameters
        if( $restorePoint !== self::PREVIOUS ) {
            $this->parameterStore[$parameter][$restorePoint] = $value;
        }

        $value = $this->query( new Raw("SET {$parameter} TO {$value}") );

        return $this;

    }
702099
public static function setOptionalValue( Option &$option, $arg )
    {
        if ( !self::isShortCode( $arg ) && !self::isLongCode( $arg ) )
        {
            if ( is_bool( $arg ) )
            {
                $option->value = ( bool )$arg;
            }
            elseif ( is_string( $arg ) )
            {
                $arg = trim( $arg );
            
                $option->value = $arg;
            }
        }
    }
25065
public function isAfter($value, $parameters)
    {
        if (!$this->isDate($value) || !$this->isDate($parameters[0])) {
            return false;
        }

        return strtotime($value) <= strtotime($parameters[0]);
    }
710650
public function setValue($value)
    {
        if (is_string($value) === true) {
            $this->value = $value;
        } else {
            $msg = "The 'value' argument must be a string, '" . gettype($value) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }