SassNumber::op_plus PHP Method

op_plus() public method

Adds the value of other to the value of this
public op_plus ( $other ) : mixed
return mixed SassNumber if other is a SassNumber or SassColour if it is a SassColour
    public function op_plus($other)
    {
        if ($other instanceof SassColour) {
            return $other->op_plus($this);
        } elseif ($other instanceof SassString) {
            $other = clone $other;
            $other->value = $this->value . $other->value;
            return $other;
        } elseif (!$other instanceof SassNumber) {
            throw new SassNumberException('Number must be a number', SassScriptParser::$context->node);
        } else {
            $other = $this->convert($other);
            return new SassNumber($this->value + $other->value . $this->units);
        }
    }