public function mode($mode)
    {
        $acceptable_modes = [-1, 0, 1, 2];
        if (!in_array($mode, $acceptable_modes)) {
            throw new JSONLibraryException('bad_mode_set');
        }
        $this->mode = $mode;

        return $this;
    }
public function mode($mode)
    {
        $acceptable_modes = [-1, 0, 1, 2];
        if (!in_array($mode, $acceptable_modes)) {
            throw new JSONLibraryException('bad_mode_set');
        }
        $this->mode = $mode;

        return $this;
    }
public function mode ( $ mode ) { $ acceptable_modes = [ - 1 , 0 , 1 , 2 ] ; if ( ! in_array ( $ mode , $ acceptable_modes ) ) { throw new JSONLibraryException ( 'bad_mode_set' ) ; } $ this -> mode = $ mode ; return $ this ; }
Set the mode fluently.

@param int $mode

@throws JSONLibraryException

@return $this
Set the mode fluently .