{"action":"created","issue":{"url":"https://api.github.com/repos/silexphp/Silex/issues/1384","repository_url":"https://api.github.com/repos/silexphp/Silex","labels_url":"https://api.github.com/repos/silexphp/Silex/issues/1384/labels{/name}","comments_url":"https://api.github.com/repos/silexphp/Silex/issues/1384/comments","events_url":"https://api.github.com/repos/silexphp/Silex/issues/1384/events","html_url":"https://github.com/silexphp/Silex/issues/1384","id":158537310,"number":1384,"title":"Identifier \"negotiator\" is not defined.","user":{"login":"lcp0578","id":10859621,"avatar_url":"https://avatars.githubusercontent.com/u/10859621?v=3","gravatar_id":"","url":"https://api.github.com/users/lcp0578","html_url":"https://github.com/lcp0578","followers_url":"https://api.github.com/users/lcp0578/followers","following_url":"https://api.github.com/users/lcp0578/following{/other_user}","gists_url":"https://api.github.com/users/lcp0578/gists{/gist_id}","starred_url":"https://api.github.com/users/lcp0578/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcp0578/subscriptions","organizations_url":"https://api.github.com/users/lcp0578/orgs","repos_url":"https://api.github.com/users/lcp0578/repos","events_url":"https://api.github.com/users/lcp0578/events{/privacy}","received_events_url":"https://api.github.com/users/lcp0578/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-05T04:47:29Z","updated_at":"2016-06-05T11:08:07Z","closed_at":null,"body":"hi,when learn chapter2:Usage , View Handlers\r\n```\r\n$app->view(function(array $controllerResult, Request $request) use ($app){\r\n    $acceptHeader = $request->headers->get('Accept');\r\n    $bestFormat = $app['negotiator']->getBestFormat($acceptHeader, array('json', 'xml'));\r\n    \r\n    if('json' === $bestFormat){\r\n        return new JsonResponse($controllerResult);\r\n    }\r\n    \r\n    if('xml' === $bestFormat){\r\n        return $app['serializer.xml']->renderResponse($controllerResult);\r\n    }\r\n    return $controllerResult;\r\n});\r\n```\r\nIdentifier \"negotiator\" is not defined.\r\n\r\nso,I find [ K-Phoen/NegotiationServiceProvider ](https://github.com/K-Phoen/NegotiationServiceProvider)\r\n```\r\ncomposer require \"kphoen/negotiation-service-provider:~1.0\"\r\n./composer.json has been updated\r\nLoading composer repositories with package information\r\nUpdating dependencies (including require-dev)\r\n  - Installing willdurand/negotiation (1.5.0)\r\n    Downloading: 100%\r\n\r\n  - Installing kphoen/negotiation-service-provider (1.0.3)\r\n    Downloading: 100%\r\n\r\nPackage kphoen/negotiation-service-provider is abandoned, you should avoid using it. No replacement was suggested.\r\nWriting lock file\r\nGenerating autoload files\r\n```\r\nbut,it didn't work.\r\n\r\nhelp me.thanks"},"comment":{"url":"https://api.github.com/repos/silexphp/Silex/issues/comments/223807086","html_url":"https://github.com/silexphp/Silex/issues/1384#issuecomment-223807086","issue_url":"https://api.github.com/repos/silexphp/Silex/issues/1384","id":223807086,"user":{"login":"lcp0578","id":10859621,"avatar_url":"https://avatars.githubusercontent.com/u/10859621?v=3","gravatar_id":"","url":"https://api.github.com/users/lcp0578","html_url":"https://github.com/lcp0578","followers_url":"https://api.github.com/users/lcp0578/followers","following_url":"https://api.github.com/users/lcp0578/following{/other_user}","gists_url":"https://api.github.com/users/lcp0578/gists{/gist_id}","starred_url":"https://api.github.com/users/lcp0578/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcp0578/subscriptions","organizations_url":"https://api.github.com/users/lcp0578/orgs","repos_url":"https://api.github.com/users/lcp0578/repos","events_url":"https://api.github.com/users/lcp0578/events{/privacy}","received_events_url":"https://api.github.com/users/lcp0578/received_events","type":"User","site_admin":false},"created_at":"2016-06-05T11:08:07Z","updated_at":"2016-06-05T11:08:07Z","body":"@GromNaN \r\nthank you,I have already register the service provide.\r\n```\r\n$app->register(new NegotiationServiceProvider(array(\r\n    'gpx' => array('application/gpx+xml'),\r\n    'kml' => array('application/vnd.google-earth.kml+xml', 'application/vnd.google-earth.kmz'),\r\n)));\r\n\r\n```\r\nI met this error\r\n```\r\nClassNotFoundException in NegotiationServiceProvider.php line 21:\r\nAttempted to load interface \"ServiceProviderInterface\" from namespace \"Silex\".\r\nDid you forget a \"use\" statement for \"Pimple\\ServiceProviderInterface\"?\r\n```\r\nso,i add \r\n`use Pimple\\ServiceProviderInterface;`\r\nbut,I met another mistake again\r\n```\r\nFatalErrorException in NegotiationServiceProvider.php line 9:\r\nCompile Error: Cannot use Pimple\\ServiceProviderInterface as ServiceProviderInterface because the name is already in use\r\n```\r\nhelp me"}}
{"actor":{"display_login":"lcp0578"}}