public function addParam(string $name, $value): self
    {
        if (!is_array($value) && !is_scalar($value) && null !== $value) {
            if (is_object($value) && method_exists($value, '__toString')) {
                $value = (string) $value;
            } else {
                throw new \InvalidArgumentException(
                        'Argument 2 passed to ' . __METHOD__ . '() must be'
                        . ' a string, array, object with __toString() method'
                        . ' or any other scalar value.'
                );
            }
        }

        $this->parameters[$name] = $value;
        return $this;
    }
public function addParam(string $name, $value): self
    {
        if (!is_array($value) && !is_scalar($value) && null !== $value) {
            if (is_object($value) && method_exists($value, '__toString')) {
                $value = (string) $value;
            } else {
                throw new \InvalidArgumentException(
                        'Argument 2 passed to ' . __METHOD__ . '() must be'
                        . ' a string, array, object with __toString() method'
                        . ' or any other scalar value.'
                );
            }
        }

        $this->parameters[$name] = $value;
        return $this;
    }
public function addParam ( string $ name , $ value ) : self { if ( ! is_array ( $ value ) && ! is_scalar ( $ value ) && null !== $ value ) { if ( is_object ( $ value ) && method_exists ( $ value , '__toString' ) ) { $ value = ( string ) $ value ; } else { throw new \ InvalidArgumentException ( 'Argument 2 passed to ' . __METHOD__ . '() must be' . ' a string, array, object with __toString() method' . ' or any other scalar value.' ) ; } } $ this -> parameters [ $ name ] = $ value ; return $ this ; }
add a parameter

@param   string  $name   name of parameter
@param   mixed   $value  value of parameter
@return  \stubbles\peer\QueryString
@throws  \InvalidArgumentException
add a parameter