public function register(Application $app)
    {
        $this->app = $app;

        $app['negotiator'] = $app->share(function ($app) {
            return new \Negotiation\Negotiator();
        });

        $app['language.negotiator'] = $app->share(function ($app) {
            return new \Negotiation\LanguageNegotiator();
        });

        $customFormats = $this->customFormats;

        $app['format.negotiator'] = $app->share(function ($app) use($customFormats) {
            $negotiator = new \Negotiation\FormatNegotiator();

            // add new formats
            foreach ($customFormats as $name => $mimeTypes) {
                $negotiator->registerFormat($name, $mimeTypes, true);
            }

            return $negotiator;
        });
    }