{"action":"created","comment":{"url":"https://api.github.com/repos/cakephp/cakephp/pulls/comments/71372020","id":71372020,"diff_hunk":"@@ -257,17 +258,18 @@ protected function _cacheConfig($action)\n      *\n      * *Note* This method will trigger an error when view rendering has a problem.\n      * This is because PHP will not allow a __toString() method to throw an exception.\n-     *\n      * @return string Rendered cell\n+     * @throws Error Include error details for PHP 7 fatal errors.\n      */\n     public function __toString()\n     {\n         try {\n             return $this->render();\n         } catch (Exception $e) {\n             trigger_error(sprintf('Could not render cell - %s [%s, line %d]', $e->getMessage(), $e->getFile(), $e->getLine()), E_USER_WARNING);\n-\n             return '';\n+        } catch(Error $e) {","path":"src/View/Cell.php","position":24,"original_position":24,"commit_id":"2d68a046a0c3cf2b38097927d6617a1260687c87","original_commit_id":"2d68a046a0c3cf2b38097927d6617a1260687c87","user":{"login":"stickler-ci","id":16011037,"avatar_url":"https://avatars.githubusercontent.com/u/16011037?v=3","gravatar_id":"","url":"https://api.github.com/users/stickler-ci","html_url":"https://github.com/stickler-ci","followers_url":"https://api.github.com/users/stickler-ci/followers","following_url":"https://api.github.com/users/stickler-ci/following{/other_user}","gists_url":"https://api.github.com/users/stickler-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/stickler-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stickler-ci/subscriptions","organizations_url":"https://api.github.com/users/stickler-ci/orgs","repos_url":"https://api.github.com/users/stickler-ci/repos","events_url":"https://api.github.com/users/stickler-ci/events{/privacy}","received_events_url":"https://api.github.com/users/stickler-ci/received_events","type":"User","site_admin":false},"body":"Expected 1 space after CATCH keyword; 0 found","created_at":"2016-07-19T16:17:49Z","updated_at":"2016-07-19T16:17:49Z","html_url":"https://github.com/cakephp/cakephp/pull/9139#discussion_r71372020","pull_request_url":"https://api.github.com/repos/cakephp/cakephp/pulls/9139","_links":{"self":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/comments/71372020"},"html":{"href":"https://github.com/cakephp/cakephp/pull/9139#discussion_r71372020"},"pull_request":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/9139"}}},"pull_request":{"url":"https://api.github.com/repos/cakephp/cakephp/pulls/9139","id":78006146,"html_url":"https://github.com/cakephp/cakephp/pull/9139","diff_url":"https://github.com/cakephp/cakephp/pull/9139.diff","patch_url":"https://github.com/cakephp/cakephp/pull/9139.patch","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/9139","number":9139,"state":"open","locked":false,"title":"Change error message for fatal errors in Cell::__toString()","user":{"login":"thinkingmedia","id":551022,"avatar_url":"https://avatars.githubusercontent.com/u/551022?v=3","gravatar_id":"","url":"https://api.github.com/users/thinkingmedia","html_url":"https://github.com/thinkingmedia","followers_url":"https://api.github.com/users/thinkingmedia/followers","following_url":"https://api.github.com/users/thinkingmedia/following{/other_user}","gists_url":"https://api.github.com/users/thinkingmedia/gists{/gist_id}","starred_url":"https://api.github.com/users/thinkingmedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thinkingmedia/subscriptions","organizations_url":"https://api.github.com/users/thinkingmedia/orgs","repos_url":"https://api.github.com/users/thinkingmedia/repos","events_url":"https://api.github.com/users/thinkingmedia/events{/privacy}","received_events_url":"https://api.github.com/users/thinkingmedia/received_events","type":"User","site_admin":false},"body":"Okay, I'm doing another PR related to fatal errors in PHP 7.\r\n\r\nIf you get a critical error in PHP 7 from inside a Cell it's not possible to see (from the error message or stack trace) the source of the error. PHP will replace the error message with a complaint that `__toString` can not throw an error. That itself happens to hide the original error. Making it difficult to find (without debugging).\r\n\r\nThere are some possible changes to this issue.\r\n\r\n## Rethrow Error with a better message\r\n\r\nCatch and throw new `Error` with a better description.\r\n\r\n```\r\n        try {\r\n            return $this->render();\r\n        } catch (Exception $e) {\r\n            trigger_error(sprintf('Could not render cell - %s [%s, line %d]', $e->getMessage(), $e->getFile(), $e->getLine()), E_USER_WARNING);\r\n            return '';\r\n        } catch(Error $e) {\r\n            throw new Error(sprintf('Could not render cell - %s [%s, line %d]', $e->getMessage(), $e->getFile(), $e->getLine()));\r\n        }\r\n```\r\n\r\n## Catching Error\r\n\r\nChange the `__toString` in `Cell.php` to catch `Error` which is very nice for me, because it formats the error message as a regular warning.\r\n\r\n```\r\n        try {\r\n            return $this->render();\r\n        } catch (Error $e) {\r\n            trigger_error(sprintf('Could not render cell - %s [%s, line %d]', $e->getMessage(), $e->getFile(), $e->getLine()), E_USER_WARNING);\r\n            return '';\r\n        }\r\n```\r\n\r\n## Deprecate __toString\r\n\r\nLet's be reasonable here. It's one line of code `$this-render()` wrapped in a `try/catch` but it's a finicky issue with PHP. PHP does not like this method to throw errors. So maybe we shouldn't be using since Cells are so critical to the rendering of the views. Had I used `$this->cell()->render()` this wouldn't be an issue, but maybe we should force people to do that.\r\n\r\n## Finally\r\n\r\nThis PR uses the first solution. It appears to work fine on PHP 5/6 ","created_at":"2016-07-19T16:17:25Z","updated_at":"2016-07-19T16:17:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"08e80535a8491ed660aab99f6854cc3e06cde1c3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cakephp/cakephp/pulls/9139/commits","review_comments_url":"https://api.github.com/repos/cakephp/cakephp/pulls/9139/comments","review_comment_url":"https://api.github.com/repos/cakephp/cakephp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/9139/comments","statuses_url":"https://api.github.com/repos/cakephp/cakephp/statuses/2d68a046a0c3cf2b38097927d6617a1260687c87","head":{"label":"thinkingmedia:thinkingmedia/cell_toString","ref":"thinkingmedia/cell_toString","sha":"2d68a046a0c3cf2b38097927d6617a1260687c87","user":{"login":"thinkingmedia","id":551022,"avatar_url":"https://avatars.githubusercontent.com/u/551022?v=3","gravatar_id":"","url":"https://api.github.com/users/thinkingmedia","html_url":"https://github.com/thinkingmedia","followers_url":"https://api.github.com/users/thinkingmedia/followers","following_url":"https://api.github.com/users/thinkingmedia/following{/other_user}","gists_url":"https://api.github.com/users/thinkingmedia/gists{/gist_id}","starred_url":"https://api.github.com/users/thinkingmedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thinkingmedia/subscriptions","organizations_url":"https://api.github.com/users/thinkingmedia/orgs","repos_url":"https://api.github.com/users/thinkingmedia/repos","events_url":"https://api.github.com/users/thinkingmedia/events{/privacy}","received_events_url":"https://api.github.com/users/thinkingmedia/received_events","type":"User","site_admin":false},"repo":{"id":34620903,"name":"cakephp","full_name":"thinkingmedia/cakephp","owner":{"login":"thinkingmedia","id":551022,"avatar_url":"https://avatars.githubusercontent.com/u/551022?v=3","gravatar_id":"","url":"https://api.github.com/users/thinkingmedia","html_url":"https://github.com/thinkingmedia","followers_url":"https://api.github.com/users/thinkingmedia/followers","following_url":"https://api.github.com/users/thinkingmedia/following{/other_user}","gists_url":"https://api.github.com/users/thinkingmedia/gists{/gist_id}","starred_url":"https://api.github.com/users/thinkingmedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thinkingmedia/subscriptions","organizations_url":"https://api.github.com/users/thinkingmedia/orgs","repos_url":"https://api.github.com/users/thinkingmedia/repos","events_url":"https://api.github.com/users/thinkingmedia/events{/privacy}","received_events_url":"https://api.github.com/users/thinkingmedia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thinkingmedia/cakephp","description":"CakePHP: The Rapid Development Framework for PHP - Official Repository","fork":true,"url":"https://api.github.com/repos/thinkingmedia/cakephp","forks_url":"https://api.github.com/repos/thinkingmedia/cakephp/forks","keys_url":"https://api.github.com/repos/thinkingmedia/cakephp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thinkingmedia/cakephp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thinkingmedia/cakephp/teams","hooks_url":"https://api.github.com/repos/thinkingmedia/cakephp/hooks","issue_events_url":"https://api.github.com/repos/thinkingmedia/cakephp/issues/events{/number}","events_url":"https://api.github.com/repos/thinkingmedia/cakephp/events","assignees_url":"https://api.github.com/repos/thinkingmedia/cakephp/assignees{/user}","branches_url":"https://api.github.com/repos/thinkingmedia/cakephp/branches{/branch}","tags_url":"https://api.github.com/repos/thinkingmedia/cakephp/tags","blobs_url":"https://api.github.com/repos/thinkingmedia/cakephp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thinkingmedia/cakephp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thinkingmedia/cakephp/git/refs{/sha}","trees_url":"https://api.github.com/repos/thinkingmedia/cakephp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thinkingmedia/cakephp/statuses/{sha}","languages_url":"https://api.github.com/repos/thinkingmedia/cakephp/languages","stargazers_url":"https://api.github.com/repos/thinkingmedia/cakephp/stargazers","contributors_url":"https://api.github.com/repos/thinkingmedia/cakephp/contributors","subscribers_url":"https://api.github.com/repos/thinkingmedia/cakephp/subscribers","subscription_url":"https://api.github.com/repos/thinkingmedia/cakephp/subscription","commits_url":"https://api.github.com/repos/thinkingmedia/cakephp/commits{/sha}","git_commits_url":"https://api.github.com/repos/thinkingmedia/cakephp/git/commits{/sha}","comments_url":"https://api.github.com/repos/thinkingmedia/cakephp/comments{/number}","issue_comment_url":"https://api.github.com/repos/thinkingmedia/cakephp/issues/comments{/number}","contents_url":"https://api.github.com/repos/thinkingmedia/cakephp/contents/{+path}","compare_url":"https://api.github.com/repos/thinkingmedia/cakephp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thinkingmedia/cakephp/merges","archive_url":"https://api.github.com/repos/thinkingmedia/cakephp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thinkingmedia/cakephp/downloads","issues_url":"https://api.github.com/repos/thinkingmedia/cakephp/issues{/number}","pulls_url":"https://api.github.com/repos/thinkingmedia/cakephp/pulls{/number}","milestones_url":"https://api.github.com/repos/thinkingmedia/cakephp/milestones{/number}","notifications_url":"https://api.github.com/repos/thinkingmedia/cakephp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thinkingmedia/cakephp/labels{/name}","releases_url":"https://api.github.com/repos/thinkingmedia/cakephp/releases{/id}","deployments_url":"https://api.github.com/repos/thinkingmedia/cakephp/deployments","created_at":"2015-04-26T16:45:21Z","updated_at":"2016-04-13T01:30:59Z","pushed_at":"2016-07-19T15:35:40Z","git_url":"git://github.com/thinkingmedia/cakephp.git","ssh_url":"git@github.com:thinkingmedia/cakephp.git","clone_url":"https://github.com/thinkingmedia/cakephp.git","svn_url":"https://github.com/thinkingmedia/cakephp","homepage":"http://cakephp.org","size":62439,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"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":"cakephp:master","ref":"master","sha":"2fd23dfd9155346929afc2ddb00611d6f9762d57","user":{"login":"cakephp","id":23666,"avatar_url":"https://avatars.githubusercontent.com/u/23666?v=3","gravatar_id":"","url":"https://api.github.com/users/cakephp","html_url":"https://github.com/cakephp","followers_url":"https://api.github.com/users/cakephp/followers","following_url":"https://api.github.com/users/cakephp/following{/other_user}","gists_url":"https://api.github.com/users/cakephp/gists{/gist_id}","starred_url":"https://api.github.com/users/cakephp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cakephp/subscriptions","organizations_url":"https://api.github.com/users/cakephp/orgs","repos_url":"https://api.github.com/users/cakephp/repos","events_url":"https://api.github.com/users/cakephp/events{/privacy}","received_events_url":"https://api.github.com/users/cakephp/received_events","type":"Organization","site_admin":false},"repo":{"id":656494,"name":"cakephp","full_name":"cakephp/cakephp","owner":{"login":"cakephp","id":23666,"avatar_url":"https://avatars.githubusercontent.com/u/23666?v=3","gravatar_id":"","url":"https://api.github.com/users/cakephp","html_url":"https://github.com/cakephp","followers_url":"https://api.github.com/users/cakephp/followers","following_url":"https://api.github.com/users/cakephp/following{/other_user}","gists_url":"https://api.github.com/users/cakephp/gists{/gist_id}","starred_url":"https://api.github.com/users/cakephp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cakephp/subscriptions","organizations_url":"https://api.github.com/users/cakephp/orgs","repos_url":"https://api.github.com/users/cakephp/repos","events_url":"https://api.github.com/users/cakephp/events{/privacy}","received_events_url":"https://api.github.com/users/cakephp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cakephp/cakephp","description":"CakePHP: The Rapid Development Framework for PHP - Official Repository","fork":false,"url":"https://api.github.com/repos/cakephp/cakephp","forks_url":"https://api.github.com/repos/cakephp/cakephp/forks","keys_url":"https://api.github.com/repos/cakephp/cakephp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cakephp/cakephp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cakephp/cakephp/teams","hooks_url":"https://api.github.com/repos/cakephp/cakephp/hooks","issue_events_url":"https://api.github.com/repos/cakephp/cakephp/issues/events{/number}","events_url":"https://api.github.com/repos/cakephp/cakephp/events","assignees_url":"https://api.github.com/repos/cakephp/cakephp/assignees{/user}","branches_url":"https://api.github.com/repos/cakephp/cakephp/branches{/branch}","tags_url":"https://api.github.com/repos/cakephp/cakephp/tags","blobs_url":"https://api.github.com/repos/cakephp/cakephp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cakephp/cakephp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cakephp/cakephp/git/refs{/sha}","trees_url":"https://api.github.com/repos/cakephp/cakephp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cakephp/cakephp/statuses/{sha}","languages_url":"https://api.github.com/repos/cakephp/cakephp/languages","stargazers_url":"https://api.github.com/repos/cakephp/cakephp/stargazers","contributors_url":"https://api.github.com/repos/cakephp/cakephp/contributors","subscribers_url":"https://api.github.com/repos/cakephp/cakephp/subscribers","subscription_url":"https://api.github.com/repos/cakephp/cakephp/subscription","commits_url":"https://api.github.com/repos/cakephp/cakephp/commits{/sha}","git_commits_url":"https://api.github.com/repos/cakephp/cakephp/git/commits{/sha}","comments_url":"https://api.github.com/repos/cakephp/cakephp/comments{/number}","issue_comment_url":"https://api.github.com/repos/cakephp/cakephp/issues/comments{/number}","contents_url":"https://api.github.com/repos/cakephp/cakephp/contents/{+path}","compare_url":"https://api.github.com/repos/cakephp/cakephp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cakephp/cakephp/merges","archive_url":"https://api.github.com/repos/cakephp/cakephp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cakephp/cakephp/downloads","issues_url":"https://api.github.com/repos/cakephp/cakephp/issues{/number}","pulls_url":"https://api.github.com/repos/cakephp/cakephp/pulls{/number}","milestones_url":"https://api.github.com/repos/cakephp/cakephp/milestones{/number}","notifications_url":"https://api.github.com/repos/cakephp/cakephp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cakephp/cakephp/labels{/name}","releases_url":"https://api.github.com/repos/cakephp/cakephp/releases{/id}","deployments_url":"https://api.github.com/repos/cakephp/cakephp/deployments","created_at":"2010-05-08T14:38:22Z","updated_at":"2016-07-19T14:03:04Z","pushed_at":"2016-07-19T16:17:25Z","git_url":"git://github.com/cakephp/cakephp.git","ssh_url":"git@github.com:cakephp/cakephp.git","clone_url":"https://github.com/cakephp/cakephp.git","svn_url":"https://github.com/cakephp/cakephp","homepage":"http://cakephp.org","size":130180,"stargazers_count":6605,"watchers_count":6605,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2989,"mirror_url":null,"open_issues_count":199,"forks":2989,"open_issues":199,"watchers":6605,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/9139"},"html":{"href":"https://github.com/cakephp/cakephp/pull/9139"},"issue":{"href":"https://api.github.com/repos/cakephp/cakephp/issues/9139"},"comments":{"href":"https://api.github.com/repos/cakephp/cakephp/issues/9139/comments"},"review_comments":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/9139/comments"},"review_comment":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/9139/commits"},"statuses":{"href":"https://api.github.com/repos/cakephp/cakephp/statuses/2d68a046a0c3cf2b38097927d6617a1260687c87"}}}}
{"actor":{"display_login":"stickler-ci"}}