GitHub PullRequestReviewCommentEvent at 2014-07-07 10:04:11
Repository: symfony
Actor: fabpot
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/14588786","id":14588786,"diff_hunk":"@@ -19,27 +19,56 @@\n class FileLoaderLoadException extends \\Exception\n {\n     /**\n-     * @param string     $resource       The resource that could not be imported\n-     * @param string     $sourceResource The original resource importing the new resource\n-     * @param int        $code           The error code\n-     * @param \\Exception $previous       A previous exception\n+     * @param string $resource The resource that could not be imported\n+     * @param string $sourceResource The original resource importing the new resource\n+     * @param int $code The error code\n+     * @param \\Exception $previous A previous exception\n      */\n     public function __construct($resource, $sourceResource = null, $code = null, $previous = null)\n     {\n-        if (null === $sourceResource) {\n-            $message = sprintf('Cannot load resource \"%s\".', $this->varToString($resource));\n+        $message = '';\n+        if ($previous) {\n+            // include the previous exception, to help the user see what might be the underlying cause\n+\n+            //Trim the trailing period of the previous message. We only want 1 period remove so no rtrim...\n+            if ('.' === substr($previous->getMessage(), -1)) {\n+                $trimmedMessage = substr($previous->getMessage(), 0, -1);\n+                $message .= ' ' . sprintf('%s', $trimmedMessage) . ' in ';\n+            } else {\n+                $message .= ' ' . sprintf('%s', $previous->getMessage()) . ' in ';\n+            }\n+            $message .= $resource . ' ';\n+\n+            // show tweaked trace to complete the human readable sentence\n+            if (null === $sourceResource) {\n+                $message .= sprintf('(which is loaded in resource \"%s\")', $this->varToString($resource));\n+            } else {\n+                $message .= sprintf(\n+                    '(which is being imported from \"%s\")',\n+                    $this->varToString($sourceResource)\n+                );\n+            }\n+            $message .= '.';\n+\n+        // if there's no previous message, present it the default way\n+        } elseif (null === $sourceResource) {\n+            $message .= sprintf('Cannot load resource \"%s\".', $this->varToString($resource));\n         } else {\n-            $message = sprintf('Cannot import resource \"%s\" from \"%s\".', $this->varToString($resource), $this->varToString($sourceResource));\n+            $message .= sprintf(\n+                'Cannot import resource \"%s\" from \"%s\".',\n+                $this->varToString($resource),\n+                $this->varToString($sourceResource)\n+            );\n         }\n \n         // Is the resource located inside a bundle?\n         if ('@' === $resource[0]) {\n             $parts = explode(DIRECTORY_SEPARATOR, $resource);\n             $bundle = substr($parts[0], 1);\n-            $message .= ' '.sprintf('Make sure the \"%s\" bundle is correctly registered and loaded in the application kernel class.', $bundle);\n-        } elseif ($previous) {\n-            // include the previous exception, to help the user see what might be the underlying cause\n-            $message .= ' '.sprintf('(%s)', $previous->getMessage());\n+            $message .= ' ' . sprintf(\n+                    'Make sure the \"%s\" bundle is correctly registered and loaded in the application kernel class.',\n+                    $bundle\n+                );","path":"src/Symfony/Component/Config/Exception/FileLoaderLoadException.php","position":64,"original_position":64,"commit_id":"676400de62dfee8fd49625443322ea3fe30b9cd1","original_commit_id":"676400de62dfee8fd49625443322ea3fe30b9cd1","user":{"login":"fabpot","id":47313,"avatar_url":"https://avatars.githubusercontent.com/u/47313?","gravatar_id":"f1a2c5905e121d09feba5ad73898ffca","url":"https://api.github.com/users/fabpot","html_url":"https://github.com/fabpot","followers_url":"https://api.github.com/users/fabpot/followers","following_url":"https://api.github.com/users/fabpot/following{/other_user}","gists_url":"https://api.github.com/users/fabpot/gists{/gist_id}","starred_url":"https://api.github.com/users/fabpot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabpot/subscriptions","organizations_url":"https://api.github.com/users/fabpot/orgs","repos_url":"https://api.github.com/users/fabpot/repos","events_url":"https://api.github.com/users/fabpot/events{/privacy}","received_events_url":"https://api.github.com/users/fabpot/received_events","type":"User","site_admin":false},"body":"should be all on one line.","created_at":"2014-07-07T10:04:11Z","updated_at":"2014-07-07T10:04:11Z","html_url":"https://github.com/symfony/symfony/pull/11313#discussion_r14588786","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/11313","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/14588786"},"html":{"href":"https://github.com/symfony/symfony/pull/11313#discussion_r14588786"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/11313"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/11313","id":18009615,"html_url":"https://github.com/symfony/symfony/pull/11313","diff_url":"https://github.com/symfony/symfony/pull/11313.diff","patch_url":"https://github.com/symfony/symfony/pull/11313.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/11313","number":11313,"state":"open","title":"[Config][Exception] Improve Routing Syntax Import Error","user":{"login":"JanDC","id":3265146,"avatar_url":"https://avatars.githubusercontent.com/u/3265146?","gravatar_id":"3826141a091311d2f726cd084c87989a","url":"https://api.github.com/users/JanDC","html_url":"https://github.com/JanDC","followers_url":"https://api.github.com/users/JanDC/followers","following_url":"https://api.github.com/users/JanDC/following{/other_user}","gists_url":"https://api.github.com/users/JanDC/gists{/gist_id}","starred_url":"https://api.github.com/users/JanDC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanDC/subscriptions","organizations_url":"https://api.github.com/users/JanDC/orgs","repos_url":"https://api.github.com/users/JanDC/repos","events_url":"https://api.github.com/users/JanDC/events{/privacy}","received_events_url":"https://api.github.com/users/JanDC/received_events","type":"User","site_admin":false},"body":"\r\n\r\n| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | no\r\n| New feature?  | no\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets | #11300\r\n| License       | MIT\r\n| Doc PR        | n/a","created_at":"2014-07-05T11:29:44Z","updated_at":"2014-07-07T10:04:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cb46b358f72cd6f20a389e7738f374993c6ff1ce","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/11313/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/11313/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments/{number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/11313/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/676400de62dfee8fd49625443322ea3fe30b9cd1","head":{"label":"JanDC:master","ref":"master","sha":"676400de62dfee8fd49625443322ea3fe30b9cd1","user":{"login":"JanDC","id":3265146,"avatar_url":"https://avatars.githubusercontent.com/u/3265146?","gravatar_id":"3826141a091311d2f726cd084c87989a","url":"https://api.github.com/users/JanDC","html_url":"https://github.com/JanDC","followers_url":"https://api.github.com/users/JanDC/followers","following_url":"https://api.github.com/users/JanDC/following{/other_user}","gists_url":"https://api.github.com/users/JanDC/gists{/gist_id}","starred_url":"https://api.github.com/users/JanDC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanDC/subscriptions","organizations_url":"https://api.github.com/users/JanDC/orgs","repos_url":"https://api.github.com/users/JanDC/repos","events_url":"https://api.github.com/users/JanDC/events{/privacy}","received_events_url":"https://api.github.com/users/JanDC/received_events","type":"User","site_admin":false},"repo":{"id":21517007,"name":"symfony","full_name":"JanDC/symfony","owner":{"login":"JanDC","id":3265146,"avatar_url":"https://avatars.githubusercontent.com/u/3265146?","gravatar_id":"3826141a091311d2f726cd084c87989a","url":"https://api.github.com/users/JanDC","html_url":"https://github.com/JanDC","followers_url":"https://api.github.com/users/JanDC/followers","following_url":"https://api.github.com/users/JanDC/following{/other_user}","gists_url":"https://api.github.com/users/JanDC/gists{/gist_id}","starred_url":"https://api.github.com/users/JanDC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanDC/subscriptions","organizations_url":"https://api.github.com/users/JanDC/orgs","repos_url":"https://api.github.com/users/JanDC/repos","events_url":"https://api.github.com/users/JanDC/events{/privacy}","received_events_url":"https://api.github.com/users/JanDC/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JanDC/symfony","description":"The Symfony PHP framework","fork":true,"url":"https://api.github.com/repos/JanDC/symfony","forks_url":"https://api.github.com/repos/JanDC/symfony/forks","keys_url":"https://api.github.com/repos/JanDC/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JanDC/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JanDC/symfony/teams","hooks_url":"https://api.github.com/repos/JanDC/symfony/hooks","issue_events_url":"https://api.github.com/repos/JanDC/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/JanDC/symfony/events","assignees_url":"https://api.github.com/repos/JanDC/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/JanDC/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/JanDC/symfony/tags","blobs_url":"https://api.github.com/repos/JanDC/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JanDC/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JanDC/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/JanDC/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JanDC/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/JanDC/symfony/languages","stargazers_url":"https://api.github.com/repos/JanDC/symfony/stargazers","contributors_url":"https://api.github.com/repos/JanDC/symfony/contributors","subscribers_url":"https://api.github.com/repos/JanDC/symfony/subscribers","subscription_url":"https://api.github.com/repos/JanDC/symfony/subscription","commits_url":"https://api.github.com/repos/JanDC/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/JanDC/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/JanDC/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/JanDC/symfony/issues/comments/{number}","contents_url":"https://api.github.com/repos/JanDC/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/JanDC/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JanDC/symfony/merges","archive_url":"https://api.github.com/repos/JanDC/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JanDC/symfony/downloads","issues_url":"https://api.github.com/repos/JanDC/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/JanDC/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/JanDC/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/JanDC/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JanDC/symfony/labels{/name}","releases_url":"https://api.github.com/repos/JanDC/symfony/releases{/id}","created_at":"2014-07-05T09:34:14Z","updated_at":"2014-07-05T11:07:38Z","pushed_at":"2014-07-06T18:24:38Z","git_url":"git://github.com/JanDC/symfony.git","ssh_url":"git@github.com:JanDC/symfony.git","clone_url":"https://github.com/JanDC/symfony.git","svn_url":"https://github.com/JanDC/symfony","homepage":"symfony.com","size":39237,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"symfony:master","ref":"master","sha":"8b54211471c815337d4b2ac67963de09779407a6","user":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?","gravatar_id":"bc6312a5b583c4258c9fad11122c6e31","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://avatars.githubusercontent.com/u/143937?","gravatar_id":"bc6312a5b583c4258c9fad11122c6e31","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}","created_at":"2010-01-04T14:21:21Z","updated_at":"2014-07-07T09:24:01Z","pushed_at":"2014-07-07T09:57:34Z","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":155470,"stargazers_count":8564,"watchers_count":8564,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"forks_count":3286,"mirror_url":null,"open_issues_count":800,"forks":3286,"open_issues":800,"watchers":8564,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/11313"},"html":{"href":"https://github.com/symfony/symfony/pull/11313"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/11313"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/11313/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/11313/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/11313/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/676400de62dfee8fd49625443322ea3fe30b9cd1"}}}}