public function setFormat($format)
    {
        switch ($format) {
            case self::FORMAT_BASE32:
                $this->encoder = new Base32Encoder();
                break;
            case self::FORMAT_HEX:
                $this->encoder = new HexEncoder();
                break;
            case self::FORMAT_RAW:
            default:
                $this->encoder = new RawEncoder();
        }

        return $this;
    }
public function setFormat($format)
    {
        switch ($format) {
            case self::FORMAT_BASE32:
                $this->encoder = new Base32Encoder();
                break;
            case self::FORMAT_HEX:
                $this->encoder = new HexEncoder();
                break;
            case self::FORMAT_RAW:
            default:
                $this->encoder = new RawEncoder();
        }

        return $this;
    }
public function setFormat ( $ format ) { switch ( $ format ) { case self :: FORMAT_BASE32 : $ this -> encoder = new Base32Encoder ( ) ; break ; case self :: FORMAT_HEX : $ this -> encoder = new HexEncoder ( ) ; break ; case self :: FORMAT_RAW : default : $ this -> encoder = new RawEncoder ( ) ; } return $ this ; }
Set the output format

@param  string  $format The new output format.
@return self    Returns an instance of self for method chaining.
Set the output format