@param $val
@param $part

@return $this
495861
public function bind($val, $part)
    {
        if (!is_array($val)) {
            $val = [$val];
        }

        foreach ($val as $v) {
            $this->bind[$part][] = $v;
        }

        return $this;
    }
1185159
public function set($key, $val = null)
    {
        if (is_array($key)) {
            $this->_setpost = array_merge($this->_setpost, $key);
        } else {
            $this->_setpost[$key] = $val;
        }
        return $this;
    }
791106
public function setStopped($val)
	{
		if (($val instanceof \DateTime)) {
			$this->stopped = $val;
		}
		else if (is_string($val) && !empty($val)) {
			try {
				// There can be accidentaly exeption thrown whenever the given
				// string is not valid date.
				$this->stopped = new \DateTime($val);
			} catch(\Exception $e) {
				$this->stopped = null;
			}
		}
		else {
			$this->stopped = null;
		}

		return $this;
	}
667941
protected function Add( $val )
	{
		$result = $this->_value->getValue() + $val->getValue()->getValue();
	    return new LongProxy( new Long( $result ) );
	}
284812
protected function Div( $val )
	{
		if ( ! $val instanceof ByteProxy ) throw new \InvalidArgumentException();
		return new DecimalProxy( Convert::ToInt( $this->_value ) / Convert::ToInt( $val->getValue() ) );
	}
1297454
public function set($name, $val)
    {
        $var = &$this->nestedValueRef($name, $this->data);

        // Mark changed
        if ($var !== $val) {
            $var = $val;
            $this->markChanged($name);
        }
        return $this;
    }
697315
public function setShouldEndSession($val){
        if($val === false) {
            $this->shouldEndSession = false; 
        }else if($val === true){
            $this->shouldEndSession = true; 
        }
    }
268207
protected function bindPartArray($var, ServerRequestInterface $request, array $parts, &$part)
    {
        if (!is_array($var) && !$var instanceof \stdClass) {
            return false;
        }
        
        $part = [$this->bind($var, $request, $parts)];
        return true;
    }
570884
public function setParam($name, $val)
    {
        if ( ! is_string($name) || ! is_string($val)) {
            return;
        }
        $this->data[$name] = $val;

        return $this;
    }
588793
protected function Promote( $val )
	{
	    return $val instanceof DecimalProxy ? $val : new DecimalProxy( Convert::ToDecimal( $val, null ) );
	}
308796
protected function Sub( $val )
	{
		if ( ! $val instanceof ByteProxy ) throw new \InvalidArgumentException();
		return new IntProxy( $this->_value - $val->_value );
	}
907540
public function part($channelarray, $reason = null,
        $priority = SMARTIRC_MEDIUM
    ) {
        if (!is_array($channelarray)) {
            $channelarray = array($channelarray);
        }

        $channellist = implode(',', $channelarray);

        if ($reason !== null) {
            $this->send('PART '.$channellist.' :'.$reason, $priority);
        } else {
            $this->send('PART '.$channellist, $priority);
        }
        return $this;
    }
747694
public function setStarted($val)
	{
		if (($val instanceof \DateTime)) {
			$this->started = $val;
		}
		else if (is_string($val) && !empty($val)) {
			try {
				// There can be accidentaly exeption thrown whenever the given
				// string is not valid date.
				$this->started = new \DateTime($val);
			} catch(\Exception $e) {
				$this->started = null;
			}
		}
		else {
			$this->started = null;
		}

		return $this;
	}
437017
public function setToView($var, $val)
    {
        $args = func_get_args();
        array_shift($args);
        $this->viewFallback($var, $args, 'set');
        return $this;
    }
124108
protected function Add( $val )
	{
		if ( ! $val instanceof ByteProxy ) throw new \InvalidArgumentException();
		return new IntProxy( $this->_value + $val->_value );
	}
1364464
public function removePart(Part $part): self
    {
        $contentType = $part->getContentType();
        if (! isset($this->parts[$contentType])) {
            return $this;
        }

        unset($this->parts[$contentType]);

        return $this;
    }
595069
public function set($part, $value)
    {
        if (!in_array($part, self::$parts)) {
            throw new \OutOfBoundsException("$part is not a valid url part");
        }

        $this->components[$part] = $value;
        return $this;
    }