{"action":"created","comment":{"url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pulls/comments/34980700","id":34980700,"diff_hunk":"@@ -0,0 +1,111 @@\n+<?php\n+\n+namespace SMG\\ManagerBundle\\Controller;\n+\n+use Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller;\n+use FOS\\RestBundle\\Controller\\Annotations;\n+use SMG\\UserBundle\\Entity\\User;\n+use FOS\\RestBundle\\View\\View;\n+use FOS\\RestBundle\\Controller\\FOSRestController;\n+use Symfony\\Component\\HttpFoundation\\Response;\n+use Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\ParamConverter;\n+use Symfony\\Component\\Serializer\\Exception\\UnexpectedValueException;\n+\n+class ManagersController extends FOSRestController\n+{\n+    use Traits\\TokenFromHeaderTrait;\n+    use Traits\\HandleUserTrait;\n+\n+    const TOKEN_DIGITS = 6;\n+\n+    /**\n+     * @Annotations\\Get(\"/only-managers-allowed\")\n+     * \n+     * @throws UnexpectedValueException\n+     *\n+     * TODO: used for test purposes only, must be deleted\n+     */\n+    public function getOnlyManagersAllowedAction()\n+    {\n+        $this->checkUserClientType('backend');\n+\n+        return $this->handleView(\n+            new View(\n+                array(\n+                    'message' => 'This manager is accepted',\n+                    Response::HTTP_ACCEPTED\n+                )\n+            )\n+        );\n+    }\n+\n+    /**\n+     * @Annotations\\Post(\"/user/add\")\n+     *\n+     * @ParamConverter(\"user\", converter=\"fos_rest.request_body\")\n+     */\n+    public function createUserAction(User $user)\n+    {\n+        try\n+        {","path":"src/SMG/ManagerBundle/Controller/ManagersController.php","position":50,"original_position":50,"commit_id":"6e5bc9fdc1a7a2ae49db415edc76096013a28de2","original_commit_id":"6e5bc9fdc1a7a2ae49db415edc76096013a28de2","user":{"login":"allan-simon","id":213167,"avatar_url":"https://avatars.githubusercontent.com/u/213167?v=3","gravatar_id":"","url":"https://api.github.com/users/allan-simon","html_url":"https://github.com/allan-simon","followers_url":"https://api.github.com/users/allan-simon/followers","following_url":"https://api.github.com/users/allan-simon/following{/other_user}","gists_url":"https://api.github.com/users/allan-simon/gists{/gist_id}","starred_url":"https://api.github.com/users/allan-simon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allan-simon/subscriptions","organizations_url":"https://api.github.com/users/allan-simon/orgs","repos_url":"https://api.github.com/users/allan-simon/repos","events_url":"https://api.github.com/users/allan-simon/events{/privacy}","received_events_url":"https://api.github.com/users/allan-simon/received_events","type":"User","site_admin":false},"body":"same line as try ,  PSR-2 my friend","created_at":"2015-07-20T09:52:07Z","updated_at":"2015-07-20T09:52:07Z","html_url":"https://github.com/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pull/12#discussion_r34980700","pull_request_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pulls/comments/34980700"},"html":{"href":"https://github.com/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pull/12#discussion_r34980700"},"pull_request":{"href":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pulls/12","id":40195811,"html_url":"https://github.com/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pull/12","diff_url":"https://github.com/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pull/12.diff","patch_url":"https://github.com/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pull/12.patch","issue_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/issues/12","number":12,"state":"open","locked":false,"title":"WIP - create the user manager bundle, add the API call to create an user","user":{"login":"jean553","id":8011398,"avatar_url":"https://avatars.githubusercontent.com/u/8011398?v=3","gravatar_id":"","url":"https://api.github.com/users/jean553","html_url":"https://github.com/jean553","followers_url":"https://api.github.com/users/jean553/followers","following_url":"https://api.github.com/users/jean553/following{/other_user}","gists_url":"https://api.github.com/users/jean553/gists{/gist_id}","starred_url":"https://api.github.com/users/jean553/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jean553/subscriptions","organizations_url":"https://api.github.com/users/jean553/orgs","repos_url":"https://api.github.com/users/jean553/repos","events_url":"https://api.github.com/users/jean553/events{/privacy}","received_events_url":"https://api.github.com/users/jean553/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-17T02:37:12Z","updated_at":"2015-07-20T09:52:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f508f4bb504543f059754ffe3525fc70f92a1b18","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pulls/12/commits","review_comments_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pulls/12/comments","review_comment_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/issues/12/comments","statuses_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/statuses/6e5bc9fdc1a7a2ae49db415edc76096013a28de2","head":{"label":"allan-simon:create_user_manager_bundle","ref":"create_user_manager_bundle","sha":"6e5bc9fdc1a7a2ae49db415edc76096013a28de2","user":{"login":"allan-simon","id":213167,"avatar_url":"https://avatars.githubusercontent.com/u/213167?v=3","gravatar_id":"","url":"https://api.github.com/users/allan-simon","html_url":"https://github.com/allan-simon","followers_url":"https://api.github.com/users/allan-simon/followers","following_url":"https://api.github.com/users/allan-simon/following{/other_user}","gists_url":"https://api.github.com/users/allan-simon/gists{/gist_id}","starred_url":"https://api.github.com/users/allan-simon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allan-simon/subscriptions","organizations_url":"https://api.github.com/users/allan-simon/orgs","repos_url":"https://api.github.com/users/allan-simon/repos","events_url":"https://api.github.com/users/allan-simon/events{/privacy}","received_events_url":"https://api.github.com/users/allan-simon/received_events","type":"User","site_admin":false},"repo":{"id":30006733,"name":"oauth2-symfony2-vagrant-fosuserbundle","full_name":"allan-simon/oauth2-symfony2-vagrant-fosuserbundle","owner":{"login":"allan-simon","id":213167,"avatar_url":"https://avatars.githubusercontent.com/u/213167?v=3","gravatar_id":"","url":"https://api.github.com/users/allan-simon","html_url":"https://github.com/allan-simon","followers_url":"https://api.github.com/users/allan-simon/followers","following_url":"https://api.github.com/users/allan-simon/following{/other_user}","gists_url":"https://api.github.com/users/allan-simon/gists{/gist_id}","starred_url":"https://api.github.com/users/allan-simon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allan-simon/subscriptions","organizations_url":"https://api.github.com/users/allan-simon/orgs","repos_url":"https://api.github.com/users/allan-simon/repos","events_url":"https://api.github.com/users/allan-simon/events{/privacy}","received_events_url":"https://api.github.com/users/allan-simon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/allan-simon/oauth2-symfony2-vagrant-fosuserbundle","description":"Oauth2 server implemented with FOSOAuthServerBundle and FOSUserBundle (and Vagrant machine for testing)","fork":false,"url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle","forks_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/forks","keys_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/teams","hooks_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/hooks","issue_events_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/issues/events{/number}","events_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/events","assignees_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/assignees{/user}","branches_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/branches{/branch}","tags_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/tags","blobs_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/statuses/{sha}","languages_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/languages","stargazers_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/stargazers","contributors_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/contributors","subscribers_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/subscribers","subscription_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/subscription","commits_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/contents/{+path}","compare_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/merges","archive_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/downloads","issues_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/issues{/number}","pulls_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pulls{/number}","milestones_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/milestones{/number}","notifications_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/labels{/name}","releases_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/releases{/id}","created_at":"2015-01-29T06:23:47Z","updated_at":"2015-04-29T02:20:52Z","pushed_at":"2015-07-20T09:42:30Z","git_url":"git://github.com/allan-simon/oauth2-symfony2-vagrant-fosuserbundle.git","ssh_url":"git@github.com:allan-simon/oauth2-symfony2-vagrant-fosuserbundle.git","clone_url":"https://github.com/allan-simon/oauth2-symfony2-vagrant-fosuserbundle.git","svn_url":"https://github.com/allan-simon/oauth2-symfony2-vagrant-fosuserbundle","homepage":null,"size":652,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"allan-simon:master","ref":"master","sha":"187345275db0bc1a6728a4bdaf181b9b86db1300","user":{"login":"allan-simon","id":213167,"avatar_url":"https://avatars.githubusercontent.com/u/213167?v=3","gravatar_id":"","url":"https://api.github.com/users/allan-simon","html_url":"https://github.com/allan-simon","followers_url":"https://api.github.com/users/allan-simon/followers","following_url":"https://api.github.com/users/allan-simon/following{/other_user}","gists_url":"https://api.github.com/users/allan-simon/gists{/gist_id}","starred_url":"https://api.github.com/users/allan-simon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allan-simon/subscriptions","organizations_url":"https://api.github.com/users/allan-simon/orgs","repos_url":"https://api.github.com/users/allan-simon/repos","events_url":"https://api.github.com/users/allan-simon/events{/privacy}","received_events_url":"https://api.github.com/users/allan-simon/received_events","type":"User","site_admin":false},"repo":{"id":30006733,"name":"oauth2-symfony2-vagrant-fosuserbundle","full_name":"allan-simon/oauth2-symfony2-vagrant-fosuserbundle","owner":{"login":"allan-simon","id":213167,"avatar_url":"https://avatars.githubusercontent.com/u/213167?v=3","gravatar_id":"","url":"https://api.github.com/users/allan-simon","html_url":"https://github.com/allan-simon","followers_url":"https://api.github.com/users/allan-simon/followers","following_url":"https://api.github.com/users/allan-simon/following{/other_user}","gists_url":"https://api.github.com/users/allan-simon/gists{/gist_id}","starred_url":"https://api.github.com/users/allan-simon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allan-simon/subscriptions","organizations_url":"https://api.github.com/users/allan-simon/orgs","repos_url":"https://api.github.com/users/allan-simon/repos","events_url":"https://api.github.com/users/allan-simon/events{/privacy}","received_events_url":"https://api.github.com/users/allan-simon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/allan-simon/oauth2-symfony2-vagrant-fosuserbundle","description":"Oauth2 server implemented with FOSOAuthServerBundle and FOSUserBundle (and Vagrant machine for testing)","fork":false,"url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle","forks_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/forks","keys_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/teams","hooks_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/hooks","issue_events_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/issues/events{/number}","events_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/events","assignees_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/assignees{/user}","branches_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/branches{/branch}","tags_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/tags","blobs_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/statuses/{sha}","languages_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/languages","stargazers_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/stargazers","contributors_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/contributors","subscribers_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/subscribers","subscription_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/subscription","commits_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/contents/{+path}","compare_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/merges","archive_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/downloads","issues_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/issues{/number}","pulls_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pulls{/number}","milestones_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/milestones{/number}","notifications_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/labels{/name}","releases_url":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/releases{/id}","created_at":"2015-01-29T06:23:47Z","updated_at":"2015-04-29T02:20:52Z","pushed_at":"2015-07-20T09:42:30Z","git_url":"git://github.com/allan-simon/oauth2-symfony2-vagrant-fosuserbundle.git","ssh_url":"git@github.com:allan-simon/oauth2-symfony2-vagrant-fosuserbundle.git","clone_url":"https://github.com/allan-simon/oauth2-symfony2-vagrant-fosuserbundle.git","svn_url":"https://github.com/allan-simon/oauth2-symfony2-vagrant-fosuserbundle","homepage":null,"size":652,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pulls/12"},"html":{"href":"https://github.com/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pull/12"},"issue":{"href":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/issues/12"},"comments":{"href":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/statuses/6e5bc9fdc1a7a2ae49db415edc76096013a28de2"}}}}