{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/165839763","pull_request_review_id":93840933,"id":165839763,"diff_hunk":"@@ -127,32 +127,56 @@ public static function register($mode = false)\n                     return $b['count'] - $a['count'];\n                 };\n \n-                foreach (array('unsilenced', 'remaining', 'legacy', 'other') as $group) {\n-                    if ($deprecations[$group.'Count']) {\n-                        echo \"\\n\", $colorize(sprintf('%s deprecation notices (%d)', ucfirst($group), $deprecations[$group.'Count']), 'legacy' !== $group), \"\\n\";\n+                $displayDeprecations = function ($deprecations) use ($colorize, $cmp) {\n+                    foreach (array('unsilenced', 'remaining', 'legacy', 'other') as $group) {\n+                        if ($deprecations[$group.'Count']) {\n+                            echo \"\\n\", $colorize(sprintf('%s deprecation notices (%d)', ucfirst($group), $deprecations[$group.'Count']), 'legacy' !== $group), \"\\n\";\n \n-                        uasort($deprecations[$group], $cmp);\n+                            uasort($deprecations[$group], $cmp);\n \n-                        foreach ($deprecations[$group] as $msg => $notices) {\n-                            echo \"\\n  \", $notices['count'], 'x: ', $msg, \"\\n\";\n+                            foreach ($deprecations[$group] as $msg => $notices) {\n+                                echo \"\\n  \", $notices['count'], 'x: ', $msg, \"\\n\";\n \n-                            arsort($notices);\n+                                arsort($notices);\n \n-                            foreach ($notices as $method => $count) {\n-                                if ('count' !== $method) {\n-                                    echo '    ', $count, 'x in ', preg_replace('/(.*)\\\\\\\\(.*?::.*?)$/', '$2 from $1', $method), \"\\n\";\n+                                foreach ($notices as $method => $count) {\n+                                    if ('count' !== $method) {\n+                                        echo '    ', $count, 'x in ', preg_replace('/(.*)\\\\\\\\(.*?::.*?)$/', '$2 from $1', $method), \"\\n\";\n+                                    }\n                                 }\n                             }\n                         }\n                     }\n-                }\n-                if (!empty($notices)) {\n-                    echo \"\\n\";\n-                }\n+                    if (!empty($notices)) {\n+                        echo \"\\n\";\n+                    }\n+                };\n+\n+                $displayDeprecations($deprecations);\n \n-                if ('weak' !== $mode && ($deprecations['unsilenced'] || $deprecations['remaining'] || $deprecations['other'])) {\n-                    exit(1);\n+                // store failing status\n+                $isFailing = 'weak' !== $mode && ($deprecations['unsilenced'] || $deprecations['remaining'] || $deprecations['other']);\n+\n+                // reset deprecations array\n+                foreach ($deprecations as $key => $arrayOrInt) {\n+                    if (is_int($arrayOrInt)) {\n+                        $deprecations[$key] = 0;\n+                    } else {\n+                        $deprecations[$key] = array();\n+                    }\n                 }\n+\n+                register_shutdown_function(function () use (&$deprecations, $isFailing, $displayDeprecations) {\n+                    if (array_sum(array_filter($deprecations, function ($key) {","path":"src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php","position":60,"original_position":60,"commit_id":"79334ef916cdf24de368a6f3a116c665cfdfd441","original_commit_id":"79334ef916cdf24de368a6f3a116c665cfdfd441","user":{"login":"nicolas-grekas","id":243674,"avatar_url":"https://avatars3.githubusercontent.com/u/243674?v=4","gravatar_id":"","url":"https://api.github.com/users/nicolas-grekas","html_url":"https://github.com/nicolas-grekas","followers_url":"https://api.github.com/users/nicolas-grekas/followers","following_url":"https://api.github.com/users/nicolas-grekas/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-grekas/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-grekas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-grekas/subscriptions","organizations_url":"https://api.github.com/users/nicolas-grekas/orgs","repos_url":"https://api.github.com/users/nicolas-grekas/repos","events_url":"https://api.github.com/users/nicolas-grekas/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-grekas/received_events","type":"User","site_admin":false},"body":"let's do a code-style fix for now :) the \"if\" should be on one line","created_at":"2018-02-04T10:24:56Z","updated_at":"2018-02-04T10:24:56Z","html_url":"https://github.com/symfony/symfony/pull/26012#discussion_r165839763","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/26012","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/165839763"},"html":{"href":"https://github.com/symfony/symfony/pull/26012#discussion_r165839763"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/26012"}},"in_reply_to_id":165814175},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/26012","id":166677197,"html_url":"https://github.com/symfony/symfony/pull/26012","diff_url":"https://github.com/symfony/symfony/pull/26012.diff","patch_url":"https://github.com/symfony/symfony/pull/26012.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/26012","number":26012,"state":"open","locked":false,"title":"Exit as late as possible","user":{"login":"greg0ire","id":657779,"avatar_url":"https://avatars1.githubusercontent.com/u/657779?v=4","gravatar_id":"","url":"https://api.github.com/users/greg0ire","html_url":"https://github.com/greg0ire","followers_url":"https://api.github.com/users/greg0ire/followers","following_url":"https://api.github.com/users/greg0ire/following{/other_user}","gists_url":"https://api.github.com/users/greg0ire/gists{/gist_id}","starred_url":"https://api.github.com/users/greg0ire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greg0ire/subscriptions","organizations_url":"https://api.github.com/users/greg0ire/orgs","repos_url":"https://api.github.com/users/greg0ire/repos","events_url":"https://api.github.com/users/greg0ire/events{/privacy}","received_events_url":"https://api.github.com/users/greg0ire/received_events","type":"User","site_admin":false},"body":"People might want to register other shutdown functions that should be\r\nable to control the exit code themselves, without the deprecation error\r\nhandler taking over. The php manual says:\r\n\r\n> If you call exit() within one registered shutdown function, processing\r\n> will stop completely and no other registered shutdown functions will be\r\n> called.\r\n\r\nSee https://secure.php.net/manual/en/function.register-shutdown-function.php\r\n\r\n| Q             | A\r\n| ------------- | ---\r\n| Branch?       | 2.7\r\n| Bug fix?      | yes\r\n| New feature?  | no\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| License       | MIT\r\n\r\n<!--\r\n- Bug fixes must be submitted against the lowest branch where they apply\r\n  (lowest branches are regularly merged to upper ones so they get the fixes too).\r\n- Features and deprecations must be submitted against the master branch.\r\n- Replace this comment by a description of what your PR is solving.\r\n-->\r\n","created_at":"2018-02-01T23:07:43Z","updated_at":"2018-02-04T10:24:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b68fb41a0bdb420cb5c7e1a139574a14bfcb8bf5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":{"url":"https://api.github.com/repos/symfony/symfony/milestones/13","html_url":"https://github.com/symfony/symfony/milestone/13","labels_url":"https://api.github.com/repos/symfony/symfony/milestones/13/labels","id":2178738,"number":13,"title":"2.7","description":"https://symfony.com/roadmap?version=2.7#checker","creator":{"login":"nicolas-grekas","id":243674,"avatar_url":"https://avatars3.githubusercontent.com/u/243674?v=4","gravatar_id":"","url":"https://api.github.com/users/nicolas-grekas","html_url":"https://github.com/nicolas-grekas","followers_url":"https://api.github.com/users/nicolas-grekas/followers","following_url":"https://api.github.com/users/nicolas-grekas/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-grekas/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-grekas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-grekas/subscriptions","organizations_url":"https://api.github.com/users/nicolas-grekas/orgs","repos_url":"https://api.github.com/users/nicolas-grekas/repos","events_url":"https://api.github.com/users/nicolas-grekas/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-grekas/received_events","type":"User","site_admin":false},"open_issues":32,"closed_issues":520,"state":"open","created_at":"2016-12-06T12:03:05Z","updated_at":"2018-02-04T10:04:06Z","due_on":"2018-05-31T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/26012/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/26012/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/26012/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/79334ef916cdf24de368a6f3a116c665cfdfd441","head":{"label":"greg0ire:defer_exit","ref":"defer_exit","sha":"79334ef916cdf24de368a6f3a116c665cfdfd441","user":{"login":"greg0ire","id":657779,"avatar_url":"https://avatars1.githubusercontent.com/u/657779?v=4","gravatar_id":"","url":"https://api.github.com/users/greg0ire","html_url":"https://github.com/greg0ire","followers_url":"https://api.github.com/users/greg0ire/followers","following_url":"https://api.github.com/users/greg0ire/following{/other_user}","gists_url":"https://api.github.com/users/greg0ire/gists{/gist_id}","starred_url":"https://api.github.com/users/greg0ire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greg0ire/subscriptions","organizations_url":"https://api.github.com/users/greg0ire/orgs","repos_url":"https://api.github.com/users/greg0ire/repos","events_url":"https://api.github.com/users/greg0ire/events{/privacy}","received_events_url":"https://api.github.com/users/greg0ire/received_events","type":"User","site_admin":false},"repo":{"id":2747803,"name":"symfony","full_name":"greg0ire/symfony","owner":{"login":"greg0ire","id":657779,"avatar_url":"https://avatars1.githubusercontent.com/u/657779?v=4","gravatar_id":"","url":"https://api.github.com/users/greg0ire","html_url":"https://github.com/greg0ire","followers_url":"https://api.github.com/users/greg0ire/followers","following_url":"https://api.github.com/users/greg0ire/following{/other_user}","gists_url":"https://api.github.com/users/greg0ire/gists{/gist_id}","starred_url":"https://api.github.com/users/greg0ire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greg0ire/subscriptions","organizations_url":"https://api.github.com/users/greg0ire/orgs","repos_url":"https://api.github.com/users/greg0ire/repos","events_url":"https://api.github.com/users/greg0ire/events{/privacy}","received_events_url":"https://api.github.com/users/greg0ire/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/greg0ire/symfony","description":"The Symfony2 PHP framework","fork":true,"url":"https://api.github.com/repos/greg0ire/symfony","forks_url":"https://api.github.com/repos/greg0ire/symfony/forks","keys_url":"https://api.github.com/repos/greg0ire/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/greg0ire/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/greg0ire/symfony/teams","hooks_url":"https://api.github.com/repos/greg0ire/symfony/hooks","issue_events_url":"https://api.github.com/repos/greg0ire/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/greg0ire/symfony/events","assignees_url":"https://api.github.com/repos/greg0ire/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/greg0ire/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/greg0ire/symfony/tags","blobs_url":"https://api.github.com/repos/greg0ire/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/greg0ire/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/greg0ire/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/greg0ire/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/greg0ire/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/greg0ire/symfony/languages","stargazers_url":"https://api.github.com/repos/greg0ire/symfony/stargazers","contributors_url":"https://api.github.com/repos/greg0ire/symfony/contributors","subscribers_url":"https://api.github.com/repos/greg0ire/symfony/subscribers","subscription_url":"https://api.github.com/repos/greg0ire/symfony/subscription","commits_url":"https://api.github.com/repos/greg0ire/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/greg0ire/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/greg0ire/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/greg0ire/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/greg0ire/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/greg0ire/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/greg0ire/symfony/merges","archive_url":"https://api.github.com/repos/greg0ire/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/greg0ire/symfony/downloads","issues_url":"https://api.github.com/repos/greg0ire/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/greg0ire/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/greg0ire/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/greg0ire/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/greg0ire/symfony/labels{/name}","releases_url":"https://api.github.com/repos/greg0ire/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/greg0ire/symfony/deployments","created_at":"2011-11-10T10:19:36Z","updated_at":"2014-05-31T12:05:49Z","pushed_at":"2018-02-03T12:27:54Z","git_url":"git://github.com/greg0ire/symfony.git","ssh_url":"git@github.com:greg0ire/symfony.git","clone_url":"https://github.com/greg0ire/symfony.git","svn_url":"https://github.com/greg0ire/symfony","homepage":"symfony.com","size":108695,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"symfony:2.7","ref":"2.7","sha":"1111da7363de62fb59aae06ed93e08106870aeba","user":{"login":"symfony","id":143937,"avatar_url":"https://avatars3.githubusercontent.com/u/143937?v=4","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"repo":{"id":458058,"name":"symfony","full_name":"symfony/symfony","owner":{"login":"symfony","id":143937,"avatar_url":"https://avatars3.githubusercontent.com/u/143937?v=4","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/symfony/symfony","description":"The Symfony PHP framework","fork":false,"url":"https://api.github.com/repos/symfony/symfony","forks_url":"https://api.github.com/repos/symfony/symfony/forks","keys_url":"https://api.github.com/repos/symfony/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/symfony/teams","hooks_url":"https://api.github.com/repos/symfony/symfony/hooks","issue_events_url":"https://api.github.com/repos/symfony/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/symfony/events","assignees_url":"https://api.github.com/repos/symfony/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/symfony/tags","blobs_url":"https://api.github.com/repos/symfony/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/symfony/languages","stargazers_url":"https://api.github.com/repos/symfony/symfony/stargazers","contributors_url":"https://api.github.com/repos/symfony/symfony/contributors","subscribers_url":"https://api.github.com/repos/symfony/symfony/subscribers","subscription_url":"https://api.github.com/repos/symfony/symfony/subscription","commits_url":"https://api.github.com/repos/symfony/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/symfony/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/symfony/merges","archive_url":"https://api.github.com/repos/symfony/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/symfony/downloads","issues_url":"https://api.github.com/repos/symfony/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/symfony/labels{/name}","releases_url":"https://api.github.com/repos/symfony/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/symfony/symfony/deployments","created_at":"2010-01-04T14:21:21Z","updated_at":"2018-02-03T21:27:43Z","pushed_at":"2018-02-04T10:01:49Z","git_url":"git://github.com/symfony/symfony.git","ssh_url":"git@github.com:symfony/symfony.git","clone_url":"https://github.com/symfony/symfony.git","svn_url":"https://github.com/symfony/symfony","homepage":"symfony.com","size":113188,"stargazers_count":16499,"watchers_count":16499,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":5986,"mirror_url":null,"archived":false,"open_issues_count":853,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":5986,"open_issues":853,"watchers":16499,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/26012"},"html":{"href":"https://github.com/symfony/symfony/pull/26012"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/26012"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/26012/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/26012/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/26012/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/79334ef916cdf24de368a6f3a116c665cfdfd441"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nicolas-grekas"}}