{"action":"created","comment":{"url":"https://api.github.com/repos/bugsnag/bugsnag-silex/pulls/comments/73655718","id":73655718,"diff_hunk":"@@ -3,77 +3,49 @@\n namespace Bugsnag\\Silex\\Provider;\n \n use Silex\\Application;\n-use Silex\\ServiceProviderInterface;\n+use Symfony\\Component\\HttpFoundation\\Request;\n+use Pimple\\Container;\n+use Pimple\\ServiceProviderInterface;\n \n class BugsnagServiceProvider implements ServiceProviderInterface\n {\n-    private static $request;\n-\n-    public function register(Application $app)\n+    public function register(Container $app)\n     {\n-        $app['bugsnag'] = $app->share(function () use($app) {\n-            $client = new \\Bugsnag_Client($app['bugsnag.options']['apiKey']);\n-            $client->setNotifier(array(\n-                'name' => 'Bugsnag Silex',\n-                'version' => '1.1.0',\n-                'url' => 'https://github.com/bugsnag/bugsnag-silex',\n-            ));\n-            set_error_handler(array($client, 'errorhandler'));\n-            set_exception_handler(array($client, 'exceptionhandler'));\n-            return $client;\n-        });\n+        $app['bugsnag'] = function ($app) {\n+            $client = \\Bugsnag\\Client::make($app['bugsnag.options']['apiKey']);\n+            \\Bugsnag\\Handler::register($client);\n \n-        /* Captures the request's information */\n-        $app->before(function ($request) {\n-            self::$request = $request;\n-        });\n-\n-        $app->error(function (\\Exception $error, $code) use($app) {\n-            $app['bugsnag']->setBeforeNotifyFunction($this->filterFramesFunc());\n+            return $client;\n+        };\n \n-            if (self::$request) {\n-                $session = self::$request->getSession();\n-                if ($session) {\n-                    $session = $session->all();\n-                }\n+        $app->error(\n+          function (\\Exception $error, Request $request) use ($app) {\n+              $params['request'] = array(\n+                'params' => $request->query->all(),\n+                'requestFormat' => $request->getRequestFormat(),\n+              );\n \n-                $qs = array();\n-                parse_str(self::$request->getQueryString(), $qs);\n+              if ($session = $request->getSession()) {\n+                  $params['session'] = $session->all();\n+              }\n \n-                $params = array(\n-                    \"request\" => array(\n-                        \"params\" => $qs,\n-                        \"requestFormat\" => self::$request->getRequestFormat(),\n-                    )\n-                );\n+              if ($cookies = $request->cookies->all()) {\n+                  $params['cookies'] = $cookies;\n+              }\n \n-                if ($session) {\n-                    $params[\"session\"] = $session;\n+              $app['bugsnag']->registerCallback(\n+                function ($report) use ($params, $error) {\n+                    $report->setMetaData($params);","path":"src/Bugsnag/Silex/Provider/BugsnagServiceProvider.php","position":73,"original_position":73,"commit_id":"3e5767360c5999498a23b324638975afdf7f1ec4","original_commit_id":"3e5767360c5999498a23b324638975afdf7f1ec4","user":{"login":"GrahamCampbell","id":2829600,"avatar_url":"https://avatars.githubusercontent.com/u/2829600?v=3","gravatar_id":"","url":"https://api.github.com/users/GrahamCampbell","html_url":"https://github.com/GrahamCampbell","followers_url":"https://api.github.com/users/GrahamCampbell/followers","following_url":"https://api.github.com/users/GrahamCampbell/following{/other_user}","gists_url":"https://api.github.com/users/GrahamCampbell/gists{/gist_id}","starred_url":"https://api.github.com/users/GrahamCampbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrahamCampbell/subscriptions","organizations_url":"https://api.github.com/users/GrahamCampbell/orgs","repos_url":"https://api.github.com/users/GrahamCampbell/repos","events_url":"https://api.github.com/users/GrahamCampbell/events{/privacy}","received_events_url":"https://api.github.com/users/GrahamCampbell/received_events","type":"User","site_admin":false},"body":"This won't work I'm afraid. This isn't metadata.","created_at":"2016-08-05T08:04:44Z","updated_at":"2016-08-05T08:04:44Z","html_url":"https://github.com/bugsnag/bugsnag-silex/pull/4#discussion_r73655718","pull_request_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/bugsnag/bugsnag-silex/pulls/comments/73655718"},"html":{"href":"https://github.com/bugsnag/bugsnag-silex/pull/4#discussion_r73655718"},"pull_request":{"href":"https://api.github.com/repos/bugsnag/bugsnag-silex/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/bugsnag/bugsnag-silex/pulls/4","id":80164264,"html_url":"https://github.com/bugsnag/bugsnag-silex/pull/4","diff_url":"https://github.com/bugsnag/bugsnag-silex/pull/4.diff","patch_url":"https://github.com/bugsnag/bugsnag-silex/pull/4.patch","issue_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/issues/4","number":4,"state":"open","locked":false,"title":"Silex 2 and Bugsnag 3 support","user":{"login":"fortis","id":1042494,"avatar_url":"https://avatars.githubusercontent.com/u/1042494?v=3","gravatar_id":"","url":"https://api.github.com/users/fortis","html_url":"https://github.com/fortis","followers_url":"https://api.github.com/users/fortis/followers","following_url":"https://api.github.com/users/fortis/following{/other_user}","gists_url":"https://api.github.com/users/fortis/gists{/gist_id}","starred_url":"https://api.github.com/users/fortis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fortis/subscriptions","organizations_url":"https://api.github.com/users/fortis/orgs","repos_url":"https://api.github.com/users/fortis/repos","events_url":"https://api.github.com/users/fortis/events{/privacy}","received_events_url":"https://api.github.com/users/fortis/received_events","type":"User","site_admin":false},"body":"Please review","created_at":"2016-08-04T23:04:23Z","updated_at":"2016-08-05T08:04:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"96bdd1eed780df379477b8843fa233fd2e869ebe","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/pulls/4/commits","review_comments_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/pulls/4/comments","review_comment_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/issues/4/comments","statuses_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/statuses/3e5767360c5999498a23b324638975afdf7f1ec4","head":{"label":"fortis:silex2-bugsnag3","ref":"silex2-bugsnag3","sha":"3e5767360c5999498a23b324638975afdf7f1ec4","user":{"login":"fortis","id":1042494,"avatar_url":"https://avatars.githubusercontent.com/u/1042494?v=3","gravatar_id":"","url":"https://api.github.com/users/fortis","html_url":"https://github.com/fortis","followers_url":"https://api.github.com/users/fortis/followers","following_url":"https://api.github.com/users/fortis/following{/other_user}","gists_url":"https://api.github.com/users/fortis/gists{/gist_id}","starred_url":"https://api.github.com/users/fortis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fortis/subscriptions","organizations_url":"https://api.github.com/users/fortis/orgs","repos_url":"https://api.github.com/users/fortis/repos","events_url":"https://api.github.com/users/fortis/events{/privacy}","received_events_url":"https://api.github.com/users/fortis/received_events","type":"User","site_admin":false},"repo":{"id":64972522,"name":"bugsnag-silex","full_name":"fortis/bugsnag-silex","owner":{"login":"fortis","id":1042494,"avatar_url":"https://avatars.githubusercontent.com/u/1042494?v=3","gravatar_id":"","url":"https://api.github.com/users/fortis","html_url":"https://github.com/fortis","followers_url":"https://api.github.com/users/fortis/followers","following_url":"https://api.github.com/users/fortis/following{/other_user}","gists_url":"https://api.github.com/users/fortis/gists{/gist_id}","starred_url":"https://api.github.com/users/fortis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fortis/subscriptions","organizations_url":"https://api.github.com/users/fortis/orgs","repos_url":"https://api.github.com/users/fortis/repos","events_url":"https://api.github.com/users/fortis/events{/privacy}","received_events_url":"https://api.github.com/users/fortis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fortis/bugsnag-silex","description":"The Bugsnag middleware for Silex","fork":true,"url":"https://api.github.com/repos/fortis/bugsnag-silex","forks_url":"https://api.github.com/repos/fortis/bugsnag-silex/forks","keys_url":"https://api.github.com/repos/fortis/bugsnag-silex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fortis/bugsnag-silex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fortis/bugsnag-silex/teams","hooks_url":"https://api.github.com/repos/fortis/bugsnag-silex/hooks","issue_events_url":"https://api.github.com/repos/fortis/bugsnag-silex/issues/events{/number}","events_url":"https://api.github.com/repos/fortis/bugsnag-silex/events","assignees_url":"https://api.github.com/repos/fortis/bugsnag-silex/assignees{/user}","branches_url":"https://api.github.com/repos/fortis/bugsnag-silex/branches{/branch}","tags_url":"https://api.github.com/repos/fortis/bugsnag-silex/tags","blobs_url":"https://api.github.com/repos/fortis/bugsnag-silex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fortis/bugsnag-silex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fortis/bugsnag-silex/git/refs{/sha}","trees_url":"https://api.github.com/repos/fortis/bugsnag-silex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fortis/bugsnag-silex/statuses/{sha}","languages_url":"https://api.github.com/repos/fortis/bugsnag-silex/languages","stargazers_url":"https://api.github.com/repos/fortis/bugsnag-silex/stargazers","contributors_url":"https://api.github.com/repos/fortis/bugsnag-silex/contributors","subscribers_url":"https://api.github.com/repos/fortis/bugsnag-silex/subscribers","subscription_url":"https://api.github.com/repos/fortis/bugsnag-silex/subscription","commits_url":"https://api.github.com/repos/fortis/bugsnag-silex/commits{/sha}","git_commits_url":"https://api.github.com/repos/fortis/bugsnag-silex/git/commits{/sha}","comments_url":"https://api.github.com/repos/fortis/bugsnag-silex/comments{/number}","issue_comment_url":"https://api.github.com/repos/fortis/bugsnag-silex/issues/comments{/number}","contents_url":"https://api.github.com/repos/fortis/bugsnag-silex/contents/{+path}","compare_url":"https://api.github.com/repos/fortis/bugsnag-silex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fortis/bugsnag-silex/merges","archive_url":"https://api.github.com/repos/fortis/bugsnag-silex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fortis/bugsnag-silex/downloads","issues_url":"https://api.github.com/repos/fortis/bugsnag-silex/issues{/number}","pulls_url":"https://api.github.com/repos/fortis/bugsnag-silex/pulls{/number}","milestones_url":"https://api.github.com/repos/fortis/bugsnag-silex/milestones{/number}","notifications_url":"https://api.github.com/repos/fortis/bugsnag-silex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fortis/bugsnag-silex/labels{/name}","releases_url":"https://api.github.com/repos/fortis/bugsnag-silex/releases{/id}","deployments_url":"https://api.github.com/repos/fortis/bugsnag-silex/deployments","created_at":"2016-08-04T22:59:36Z","updated_at":"2016-08-04T22:59:37Z","pushed_at":"2016-08-04T23:03:17Z","git_url":"git://github.com/fortis/bugsnag-silex.git","ssh_url":"git@github.com:fortis/bugsnag-silex.git","clone_url":"https://github.com/fortis/bugsnag-silex.git","svn_url":"https://github.com/fortis/bugsnag-silex","homepage":"","size":23,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bugsnag:master","ref":"master","sha":"edad89a557016b765c0454e2455f7b151d052d2b","user":{"login":"bugsnag","id":1058895,"avatar_url":"https://avatars.githubusercontent.com/u/1058895?v=3","gravatar_id":"","url":"https://api.github.com/users/bugsnag","html_url":"https://github.com/bugsnag","followers_url":"https://api.github.com/users/bugsnag/followers","following_url":"https://api.github.com/users/bugsnag/following{/other_user}","gists_url":"https://api.github.com/users/bugsnag/gists{/gist_id}","starred_url":"https://api.github.com/users/bugsnag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bugsnag/subscriptions","organizations_url":"https://api.github.com/users/bugsnag/orgs","repos_url":"https://api.github.com/users/bugsnag/repos","events_url":"https://api.github.com/users/bugsnag/events{/privacy}","received_events_url":"https://api.github.com/users/bugsnag/received_events","type":"Organization","site_admin":false},"repo":{"id":23802949,"name":"bugsnag-silex","full_name":"bugsnag/bugsnag-silex","owner":{"login":"bugsnag","id":1058895,"avatar_url":"https://avatars.githubusercontent.com/u/1058895?v=3","gravatar_id":"","url":"https://api.github.com/users/bugsnag","html_url":"https://github.com/bugsnag","followers_url":"https://api.github.com/users/bugsnag/followers","following_url":"https://api.github.com/users/bugsnag/following{/other_user}","gists_url":"https://api.github.com/users/bugsnag/gists{/gist_id}","starred_url":"https://api.github.com/users/bugsnag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bugsnag/subscriptions","organizations_url":"https://api.github.com/users/bugsnag/orgs","repos_url":"https://api.github.com/users/bugsnag/repos","events_url":"https://api.github.com/users/bugsnag/events{/privacy}","received_events_url":"https://api.github.com/users/bugsnag/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bugsnag/bugsnag-silex","description":"The Bugsnag middleware for Silex","fork":false,"url":"https://api.github.com/repos/bugsnag/bugsnag-silex","forks_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/forks","keys_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/teams","hooks_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/hooks","issue_events_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/issues/events{/number}","events_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/events","assignees_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/assignees{/user}","branches_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/branches{/branch}","tags_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/tags","blobs_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/git/refs{/sha}","trees_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/statuses/{sha}","languages_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/languages","stargazers_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/stargazers","contributors_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/contributors","subscribers_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/subscribers","subscription_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/subscription","commits_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/commits{/sha}","git_commits_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/git/commits{/sha}","comments_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/comments{/number}","issue_comment_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/issues/comments{/number}","contents_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/contents/{+path}","compare_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/merges","archive_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/downloads","issues_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/issues{/number}","pulls_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/pulls{/number}","milestones_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/milestones{/number}","notifications_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/labels{/name}","releases_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/releases{/id}","deployments_url":"https://api.github.com/repos/bugsnag/bugsnag-silex/deployments","created_at":"2014-09-08T18:30:32Z","updated_at":"2016-07-06T16:56:45Z","pushed_at":"2016-08-04T23:04:23Z","git_url":"git://github.com/bugsnag/bugsnag-silex.git","ssh_url":"git@github.com:bugsnag/bugsnag-silex.git","clone_url":"https://github.com/bugsnag/bugsnag-silex.git","svn_url":"https://github.com/bugsnag/bugsnag-silex","homepage":"","size":21,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bugsnag/bugsnag-silex/pulls/4"},"html":{"href":"https://github.com/bugsnag/bugsnag-silex/pull/4"},"issue":{"href":"https://api.github.com/repos/bugsnag/bugsnag-silex/issues/4"},"comments":{"href":"https://api.github.com/repos/bugsnag/bugsnag-silex/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/bugsnag/bugsnag-silex/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/bugsnag/bugsnag-silex/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bugsnag/bugsnag-silex/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/bugsnag/bugsnag-silex/statuses/3e5767360c5999498a23b324638975afdf7f1ec4"}}}}
{"actor":{"display_login":"GrahamCampbell"}}