public function setDecoder($name, $decoder = null)
    {
        if (!isset($decoder)) {
            $decoder = '\OtherCode\Rest\Modules\Decoders\\' . strtoupper($name) . 'Decoder';
        }

        if (class_exists($decoder, true)) {
            $this->registerModule($name, new $decoder($this->response), 'after');
        } else {
            throw new \OtherCode\Rest\Exceptions\ModuleNotFoundException('Decoder ' . $name . ' not found!');
        }
        return $this;
    }
public function setDecoder($name, $decoder = null)
    {
        if (!isset($decoder)) {
            $decoder = '\OtherCode\Rest\Modules\Decoders\\' . strtoupper($name) . 'Decoder';
        }

        if (class_exists($decoder, true)) {
            $this->registerModule($name, new $decoder($this->response), 'after');
        } else {
            throw new \OtherCode\Rest\Exceptions\ModuleNotFoundException('Decoder ' . $name . ' not found!');
        }
        return $this;
    }
public function setDecoder ( $ name , $ decoder = null ) { if ( ! isset ( $ decoder ) ) { $ decoder = '\OtherCode\Rest\Modules\Decoders\\' . strtoupper ( $ name ) . 'Decoder' ; } if ( class_exists ( $ decoder , true ) ) { $ this -> registerModule ( $ name , new $ decoder ( $ this -> response ) , 'after' ) ; } else { throw new \ OtherCode \ Rest \ Exceptions \ ModuleNotFoundException ( 'Decoder ' . $ name . ' not found!' ) ; } return $ this ; }
Set a new decoder instance
@param string $name Decoder unique name
@param string $decoder Decoder class name with namespace
@throws \OtherCode\Rest\Exceptions\ModuleNotFoundException
@return $this
Set a new decoder instance