public function setCode($code)
    {
        if (!is_scalar($code)) {
            throw new InvalidArgumentException(
                sprintf(
                    'Wrong parameters for %s([int|string $code]); %s given.',
                    __METHOD__,
                    is_object($code) ? get_class($code) : gettype($code)
                ),
                E_ERROR
            );
        }

        $this->code = $code;

        return $this;
    }
public function setCode($code)
    {
        if (!is_scalar($code)) {
            throw new InvalidArgumentException(
                sprintf(
                    'Wrong parameters for %s([int|string $code]); %s given.',
                    __METHOD__,
                    is_object($code) ? get_class($code) : gettype($code)
                ),
                E_ERROR
            );
        }

        $this->code = $code;

        return $this;
    }
public function setCode ( $ code ) { if ( ! is_scalar ( $ code ) ) { throw new InvalidArgumentException ( sprintf ( 'Wrong parameters for %s([int|string $code]); %s given.' , __METHOD__ , is_object ( $ code ) ? get_class ( $ code ) : gettype ( $ code ) ) , E_ERROR ) ; } $ this -> code = $ code ; return $ this ; }
Sets the Exception code.

@param int|string $code

@return static
@throws InvalidArgumentException
Sets the Exception code .