{"action":"created","comment":{"url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/comments/38264323","id":38264323,"diff_hunk":"@@ -366,6 +387,21 @@ private function getMethodArguments(\\ReflectionMethod $method)\n     }\n \n     /**\n+     * Generates final resource name.\n+     *\n+     * @param string|bool $resource\n+     *\n+     * @return string\n+     */\n+    private function generateResourceName($resource)\n+    {\n+        if(false !== $this->pluralize) {","path":"Routing/Loader/Reader/RestActionReader.php","position":59,"original_position":59,"commit_id":"83ee4e69a71ae8f0a62fcc5421817a1422fa08ff","original_commit_id":"83ee4e69a71ae8f0a62fcc5421817a1422fa08ff","user":{"login":"lsmith77","id":300279,"avatar_url":"https://avatars.githubusercontent.com/u/300279?v=3","gravatar_id":"","url":"https://api.github.com/users/lsmith77","html_url":"https://github.com/lsmith77","followers_url":"https://api.github.com/users/lsmith77/followers","following_url":"https://api.github.com/users/lsmith77/following{/other_user}","gists_url":"https://api.github.com/users/lsmith77/gists{/gist_id}","starred_url":"https://api.github.com/users/lsmith77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsmith77/subscriptions","organizations_url":"https://api.github.com/users/lsmith77/orgs","repos_url":"https://api.github.com/users/lsmith77/repos","events_url":"https://api.github.com/users/lsmith77/events{/privacy}","received_events_url":"https://api.github.com/users/lsmith77/received_events","type":"User","site_admin":false},"body":"also I would change this to return early ..\r\n\r\n```\r\nif (!$this->pluralize) {\r\n    return $resource;\r\n}\r\n\r\nreturn $resource = $this->inflector->pluralize((string)$resource);\r\n```","created_at":"2015-08-29T17:54:15Z","updated_at":"2015-08-29T17:54:15Z","html_url":"https://github.com/FriendsOfSymfony/FOSRestBundle/pull/1096#discussion_r38264323","pull_request_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/1096","_links":{"self":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/comments/38264323"},"html":{"href":"https://github.com/FriendsOfSymfony/FOSRestBundle/pull/1096#discussion_r38264323"},"pull_request":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/1096"}}},"pull_request":{"url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/1096","id":42642518,"html_url":"https://github.com/FriendsOfSymfony/FOSRestBundle/pull/1096","diff_url":"https://github.com/FriendsOfSymfony/FOSRestBundle/pull/1096.diff","patch_url":"https://github.com/FriendsOfSymfony/FOSRestBundle/pull/1096.patch","issue_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/1096","number":1096,"state":"open","locked":false,"title":"Add support of non-pluralized resource names","user":{"login":"Ener-Getick","id":6871899,"avatar_url":"https://avatars.githubusercontent.com/u/6871899?v=3","gravatar_id":"","url":"https://api.github.com/users/Ener-Getick","html_url":"https://github.com/Ener-Getick","followers_url":"https://api.github.com/users/Ener-Getick/followers","following_url":"https://api.github.com/users/Ener-Getick/following{/other_user}","gists_url":"https://api.github.com/users/Ener-Getick/gists{/gist_id}","starred_url":"https://api.github.com/users/Ener-Getick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ener-Getick/subscriptions","organizations_url":"https://api.github.com/users/Ener-Getick/orgs","repos_url":"https://api.github.com/users/Ener-Getick/repos","events_url":"https://api.github.com/users/Ener-Getick/events{/privacy}","received_events_url":"https://api.github.com/users/Ener-Getick/received_events","type":"User","site_admin":false},"body":"I decided to create a new PR about #294 because #531 seems to be abandoned.\r\n\r\nThis PR add the support of non-pluralized resource names as described in #294.\r\n\r\nYou can use it like that:\r\n```php\r\n<?php\r\n\r\n/**\r\n *  @Rest\\RouteResource(resource=\"Article\", pluralize=false)\r\n */\r\nclass FooController extends FosRestController\r\n{\r\n\r\n    public function cgetAction()\r\n    {} // [GET] /article\r\n\r\n    public function getAction($slug)\r\n    {} // [GET] /article/{slug}\r\n\r\n    public function cgetCommentAction($slug)\r\n    {} // [GET] /article/{slug}/comment\r\n    \r\n}\r\n```","created_at":"2015-08-17T22:35:54Z","updated_at":"2015-08-29T17:54:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d339e08c15aa4d7ddd411ea6d3e4bb46019d004","assignee":null,"milestone":{"url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/milestones/5","html_url":"https://github.com/FriendsOfSymfony/FOSRestBundle/milestones/2.0","labels_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/milestones/5/labels","id":954486,"number":5,"title":"2.0","description":"","creator":{"login":"lsmith77","id":300279,"avatar_url":"https://avatars.githubusercontent.com/u/300279?v=3","gravatar_id":"","url":"https://api.github.com/users/lsmith77","html_url":"https://github.com/lsmith77","followers_url":"https://api.github.com/users/lsmith77/followers","following_url":"https://api.github.com/users/lsmith77/following{/other_user}","gists_url":"https://api.github.com/users/lsmith77/gists{/gist_id}","starred_url":"https://api.github.com/users/lsmith77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsmith77/subscriptions","organizations_url":"https://api.github.com/users/lsmith77/orgs","repos_url":"https://api.github.com/users/lsmith77/repos","events_url":"https://api.github.com/users/lsmith77/events{/privacy}","received_events_url":"https://api.github.com/users/lsmith77/received_events","type":"User","site_admin":false},"open_issues":60,"closed_issues":4,"state":"open","created_at":"2015-01-28T08:04:14Z","updated_at":"2015-08-29T16:54:24Z","due_on":"2015-11-29T23:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/1096/commits","review_comments_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/1096/comments","review_comment_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/1096/comments","statuses_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/statuses/83ee4e69a71ae8f0a62fcc5421817a1422fa08ff","head":{"label":"Ener-Getick:ISSUE_294","ref":"ISSUE_294","sha":"83ee4e69a71ae8f0a62fcc5421817a1422fa08ff","user":{"login":"Ener-Getick","id":6871899,"avatar_url":"https://avatars.githubusercontent.com/u/6871899?v=3","gravatar_id":"","url":"https://api.github.com/users/Ener-Getick","html_url":"https://github.com/Ener-Getick","followers_url":"https://api.github.com/users/Ener-Getick/followers","following_url":"https://api.github.com/users/Ener-Getick/following{/other_user}","gists_url":"https://api.github.com/users/Ener-Getick/gists{/gist_id}","starred_url":"https://api.github.com/users/Ener-Getick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ener-Getick/subscriptions","organizations_url":"https://api.github.com/users/Ener-Getick/orgs","repos_url":"https://api.github.com/users/Ener-Getick/repos","events_url":"https://api.github.com/users/Ener-Getick/events{/privacy}","received_events_url":"https://api.github.com/users/Ener-Getick/received_events","type":"User","site_admin":false},"repo":{"id":37521946,"name":"FOSRestBundle","full_name":"Ener-Getick/FOSRestBundle","owner":{"login":"Ener-Getick","id":6871899,"avatar_url":"https://avatars.githubusercontent.com/u/6871899?v=3","gravatar_id":"","url":"https://api.github.com/users/Ener-Getick","html_url":"https://github.com/Ener-Getick","followers_url":"https://api.github.com/users/Ener-Getick/followers","following_url":"https://api.github.com/users/Ener-Getick/following{/other_user}","gists_url":"https://api.github.com/users/Ener-Getick/gists{/gist_id}","starred_url":"https://api.github.com/users/Ener-Getick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ener-Getick/subscriptions","organizations_url":"https://api.github.com/users/Ener-Getick/orgs","repos_url":"https://api.github.com/users/Ener-Getick/repos","events_url":"https://api.github.com/users/Ener-Getick/events{/privacy}","received_events_url":"https://api.github.com/users/Ener-Getick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ener-Getick/FOSRestBundle","description":"This Bundle provides various tools to rapidly develop RESTful API's with Symfony2","fork":true,"url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle","forks_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/forks","keys_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/teams","hooks_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/hooks","issue_events_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/issues/events{/number}","events_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/events","assignees_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/assignees{/user}","branches_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/branches{/branch}","tags_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/tags","blobs_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/languages","stargazers_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/stargazers","contributors_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/contributors","subscribers_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/subscribers","subscription_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/subscription","commits_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/contents/{+path}","compare_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/merges","archive_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/downloads","issues_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/issues{/number}","pulls_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/labels{/name}","releases_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/releases{/id}","created_at":"2015-06-16T09:50:51Z","updated_at":"2015-06-16T09:50:51Z","pushed_at":"2015-08-29T17:30:11Z","git_url":"git://github.com/Ener-Getick/FOSRestBundle.git","ssh_url":"git@github.com:Ener-Getick/FOSRestBundle.git","clone_url":"https://github.com/Ener-Getick/FOSRestBundle.git","svn_url":"https://github.com/Ener-Getick/FOSRestBundle","homepage":"http://friendsofsymfony.github.com/","size":3101,"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":"FriendsOfSymfony:master","ref":"master","sha":"35b43ae45249bc60dd398a4996efe4e3829878ac","user":{"login":"FriendsOfSymfony","id":529709,"avatar_url":"https://avatars.githubusercontent.com/u/529709?v=3","gravatar_id":"","url":"https://api.github.com/users/FriendsOfSymfony","html_url":"https://github.com/FriendsOfSymfony","followers_url":"https://api.github.com/users/FriendsOfSymfony/followers","following_url":"https://api.github.com/users/FriendsOfSymfony/following{/other_user}","gists_url":"https://api.github.com/users/FriendsOfSymfony/gists{/gist_id}","starred_url":"https://api.github.com/users/FriendsOfSymfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FriendsOfSymfony/subscriptions","organizations_url":"https://api.github.com/users/FriendsOfSymfony/orgs","repos_url":"https://api.github.com/users/FriendsOfSymfony/repos","events_url":"https://api.github.com/users/FriendsOfSymfony/events{/privacy}","received_events_url":"https://api.github.com/users/FriendsOfSymfony/received_events","type":"Organization","site_admin":false},"repo":{"id":1509011,"name":"FOSRestBundle","full_name":"FriendsOfSymfony/FOSRestBundle","owner":{"login":"FriendsOfSymfony","id":529709,"avatar_url":"https://avatars.githubusercontent.com/u/529709?v=3","gravatar_id":"","url":"https://api.github.com/users/FriendsOfSymfony","html_url":"https://github.com/FriendsOfSymfony","followers_url":"https://api.github.com/users/FriendsOfSymfony/followers","following_url":"https://api.github.com/users/FriendsOfSymfony/following{/other_user}","gists_url":"https://api.github.com/users/FriendsOfSymfony/gists{/gist_id}","starred_url":"https://api.github.com/users/FriendsOfSymfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FriendsOfSymfony/subscriptions","organizations_url":"https://api.github.com/users/FriendsOfSymfony/orgs","repos_url":"https://api.github.com/users/FriendsOfSymfony/repos","events_url":"https://api.github.com/users/FriendsOfSymfony/events{/privacy}","received_events_url":"https://api.github.com/users/FriendsOfSymfony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FriendsOfSymfony/FOSRestBundle","description":"This Bundle provides various tools to rapidly develop RESTful API's with Symfony2","fork":false,"url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle","forks_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/forks","keys_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/teams","hooks_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/hooks","issue_events_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/events{/number}","events_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/events","assignees_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/assignees{/user}","branches_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/branches{/branch}","tags_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/tags","blobs_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/languages","stargazers_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/stargazers","contributors_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/contributors","subscribers_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/subscribers","subscription_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/subscription","commits_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/contents/{+path}","compare_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/merges","archive_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/downloads","issues_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues{/number}","pulls_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/labels{/name}","releases_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/releases{/id}","created_at":"2011-03-21T23:14:13Z","updated_at":"2015-08-28T13:33:45Z","pushed_at":"2015-08-29T17:30:14Z","git_url":"git://github.com/FriendsOfSymfony/FOSRestBundle.git","ssh_url":"git@github.com:FriendsOfSymfony/FOSRestBundle.git","clone_url":"https://github.com/FriendsOfSymfony/FOSRestBundle.git","svn_url":"https://github.com/FriendsOfSymfony/FOSRestBundle","homepage":"http://friendsofsymfony.github.com/","size":6408,"stargazers_count":1201,"watchers_count":1201,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":470,"mirror_url":null,"open_issues_count":69,"forks":470,"open_issues":69,"watchers":1201,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/1096"},"html":{"href":"https://github.com/FriendsOfSymfony/FOSRestBundle/pull/1096"},"issue":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/1096"},"comments":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/1096/comments"},"review_comments":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/1096/comments"},"review_comment":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/1096/commits"},"statuses":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/statuses/83ee4e69a71ae8f0a62fcc5421817a1422fa08ff"}}}}