{"action":"created","comment":{"url":"https://api.github.com/repos/stfalcon-studio/rock-events/pulls/comments/51761504","id":51761504,"diff_hunk":"@@ -0,0 +1,84 @@\n+<?php\n+\n+namespace AppBundle\\Security\\Provider;\n+\n+use AppBundle\\Entity\\User;\n+use FOS\\UserBundle\\Model\\UserManagerInterface;\n+use HWI\\Bundle\\OAuthBundle\\OAuth\\Response\\UserResponseInterface;\n+use HWI\\Bundle\\OAuthBundle\\Security\\Core\\User\\FOSUBUserProvider as BaseClass;\n+use Symfony\\Component\\Security\\Core\\Exception\\AuthenticationException;\n+use Symfony\\Component\\Security\\Core\\User\\UserInterface;\n+\n+/**\n+ * OAuthUserProvider class\n+ *\n+ * @author Yevgeniy Zholkevskiy <blackbullet@i.ua>\n+ */\n+class OAuthUserProvider extends BaseClass\n+{\n+    /**\n+     * {@inheritDoc}\n+     */\n+    public function connect(UserInterface $user, UserResponseInterface $response)\n+    {\n+        $property = $this->getProperty($response);\n+        $username = $response->getUsername();\n+\n+        //on connect - get the access token and the user ID\n+        $service = $response->getResourceOwner()->getName();\n+\n+        $setter      = 'set'.ucfirst($service);\n+        $setterId    = $setter.'Id';\n+        $setterToken = $setter.'AccessToken';\n+\n+        if (null !== $previousUser = $this->userManager->findUserBy([$property => $username])) {","path":"src/AppBundle/Security/Provider/OAuthUserProvider.php","position":34,"original_position":34,"commit_id":"5d77cf0f1885a9e85cea02a226e88b1f000d41ed","original_commit_id":"5d77cf0f1885a9e85cea02a226e88b1f000d41ed","user":{"login":"LogansUA","id":7515743,"avatar_url":"https://avatars.githubusercontent.com/u/7515743?v=3","gravatar_id":"","url":"https://api.github.com/users/LogansUA","html_url":"https://github.com/LogansUA","followers_url":"https://api.github.com/users/LogansUA/followers","following_url":"https://api.github.com/users/LogansUA/following{/other_user}","gists_url":"https://api.github.com/users/LogansUA/gists{/gist_id}","starred_url":"https://api.github.com/users/LogansUA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LogansUA/subscriptions","organizations_url":"https://api.github.com/users/LogansUA/orgs","repos_url":"https://api.github.com/users/LogansUA/repos","events_url":"https://api.github.com/users/LogansUA/events{/privacy}","received_events_url":"https://api.github.com/users/LogansUA/received_events","type":"User","site_admin":false},"body":"Так краще не робити. Винеси це присвоювання з if'a","created_at":"2016-02-03T18:08:20Z","updated_at":"2016-02-03T18:08:20Z","html_url":"https://github.com/stfalcon-studio/rock-events/pull/22#discussion_r51761504","pull_request_url":"https://api.github.com/repos/stfalcon-studio/rock-events/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/stfalcon-studio/rock-events/pulls/comments/51761504"},"html":{"href":"https://github.com/stfalcon-studio/rock-events/pull/22#discussion_r51761504"},"pull_request":{"href":"https://api.github.com/repos/stfalcon-studio/rock-events/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/stfalcon-studio/rock-events/pulls/22","id":58114426,"html_url":"https://github.com/stfalcon-studio/rock-events/pull/22","diff_url":"https://github.com/stfalcon-studio/rock-events/pull/22.diff","patch_url":"https://github.com/stfalcon-studio/rock-events/pull/22.patch","issue_url":"https://api.github.com/repos/stfalcon-studio/rock-events/issues/22","number":22,"state":"open","locked":false,"title":"Feature social","user":{"login":"black-bullet","id":9662462,"avatar_url":"https://avatars.githubusercontent.com/u/9662462?v=3","gravatar_id":"","url":"https://api.github.com/users/black-bullet","html_url":"https://github.com/black-bullet","followers_url":"https://api.github.com/users/black-bullet/followers","following_url":"https://api.github.com/users/black-bullet/following{/other_user}","gists_url":"https://api.github.com/users/black-bullet/gists{/gist_id}","starred_url":"https://api.github.com/users/black-bullet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/black-bullet/subscriptions","organizations_url":"https://api.github.com/users/black-bullet/orgs","repos_url":"https://api.github.com/users/black-bullet/repos","events_url":"https://api.github.com/users/black-bullet/events{/privacy}","received_events_url":"https://api.github.com/users/black-bullet/received_events","type":"User","site_admin":false},"body":"Create social authorization via:\r\n* facebook\r\n* vk\r\n* google","created_at":"2016-02-03T09:59:38Z","updated_at":"2016-02-03T18:08:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e50391de0cb2e772894efdc758cd5a3303f96953","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/stfalcon-studio/rock-events/pulls/22/commits","review_comments_url":"https://api.github.com/repos/stfalcon-studio/rock-events/pulls/22/comments","review_comment_url":"https://api.github.com/repos/stfalcon-studio/rock-events/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stfalcon-studio/rock-events/issues/22/comments","statuses_url":"https://api.github.com/repos/stfalcon-studio/rock-events/statuses/5d77cf0f1885a9e85cea02a226e88b1f000d41ed","head":{"label":"black-bullet:feature-social","ref":"feature-social","sha":"5d77cf0f1885a9e85cea02a226e88b1f000d41ed","user":{"login":"black-bullet","id":9662462,"avatar_url":"https://avatars.githubusercontent.com/u/9662462?v=3","gravatar_id":"","url":"https://api.github.com/users/black-bullet","html_url":"https://github.com/black-bullet","followers_url":"https://api.github.com/users/black-bullet/followers","following_url":"https://api.github.com/users/black-bullet/following{/other_user}","gists_url":"https://api.github.com/users/black-bullet/gists{/gist_id}","starred_url":"https://api.github.com/users/black-bullet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/black-bullet/subscriptions","organizations_url":"https://api.github.com/users/black-bullet/orgs","repos_url":"https://api.github.com/users/black-bullet/repos","events_url":"https://api.github.com/users/black-bullet/events{/privacy}","received_events_url":"https://api.github.com/users/black-bullet/received_events","type":"User","site_admin":false},"repo":{"id":49647638,"name":"rock-events","full_name":"black-bullet/rock-events","owner":{"login":"black-bullet","id":9662462,"avatar_url":"https://avatars.githubusercontent.com/u/9662462?v=3","gravatar_id":"","url":"https://api.github.com/users/black-bullet","html_url":"https://github.com/black-bullet","followers_url":"https://api.github.com/users/black-bullet/followers","following_url":"https://api.github.com/users/black-bullet/following{/other_user}","gists_url":"https://api.github.com/users/black-bullet/gists{/gist_id}","starred_url":"https://api.github.com/users/black-bullet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/black-bullet/subscriptions","organizations_url":"https://api.github.com/users/black-bullet/orgs","repos_url":"https://api.github.com/users/black-bullet/repos","events_url":"https://api.github.com/users/black-bullet/events{/privacy}","received_events_url":"https://api.github.com/users/black-bullet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/black-bullet/rock-events","description":"","fork":true,"url":"https://api.github.com/repos/black-bullet/rock-events","forks_url":"https://api.github.com/repos/black-bullet/rock-events/forks","keys_url":"https://api.github.com/repos/black-bullet/rock-events/keys{/key_id}","collaborators_url":"https://api.github.com/repos/black-bullet/rock-events/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/black-bullet/rock-events/teams","hooks_url":"https://api.github.com/repos/black-bullet/rock-events/hooks","issue_events_url":"https://api.github.com/repos/black-bullet/rock-events/issues/events{/number}","events_url":"https://api.github.com/repos/black-bullet/rock-events/events","assignees_url":"https://api.github.com/repos/black-bullet/rock-events/assignees{/user}","branches_url":"https://api.github.com/repos/black-bullet/rock-events/branches{/branch}","tags_url":"https://api.github.com/repos/black-bullet/rock-events/tags","blobs_url":"https://api.github.com/repos/black-bullet/rock-events/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/black-bullet/rock-events/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/black-bullet/rock-events/git/refs{/sha}","trees_url":"https://api.github.com/repos/black-bullet/rock-events/git/trees{/sha}","statuses_url":"https://api.github.com/repos/black-bullet/rock-events/statuses/{sha}","languages_url":"https://api.github.com/repos/black-bullet/rock-events/languages","stargazers_url":"https://api.github.com/repos/black-bullet/rock-events/stargazers","contributors_url":"https://api.github.com/repos/black-bullet/rock-events/contributors","subscribers_url":"https://api.github.com/repos/black-bullet/rock-events/subscribers","subscription_url":"https://api.github.com/repos/black-bullet/rock-events/subscription","commits_url":"https://api.github.com/repos/black-bullet/rock-events/commits{/sha}","git_commits_url":"https://api.github.com/repos/black-bullet/rock-events/git/commits{/sha}","comments_url":"https://api.github.com/repos/black-bullet/rock-events/comments{/number}","issue_comment_url":"https://api.github.com/repos/black-bullet/rock-events/issues/comments{/number}","contents_url":"https://api.github.com/repos/black-bullet/rock-events/contents/{+path}","compare_url":"https://api.github.com/repos/black-bullet/rock-events/compare/{base}...{head}","merges_url":"https://api.github.com/repos/black-bullet/rock-events/merges","archive_url":"https://api.github.com/repos/black-bullet/rock-events/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/black-bullet/rock-events/downloads","issues_url":"https://api.github.com/repos/black-bullet/rock-events/issues{/number}","pulls_url":"https://api.github.com/repos/black-bullet/rock-events/pulls{/number}","milestones_url":"https://api.github.com/repos/black-bullet/rock-events/milestones{/number}","notifications_url":"https://api.github.com/repos/black-bullet/rock-events/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/black-bullet/rock-events/labels{/name}","releases_url":"https://api.github.com/repos/black-bullet/rock-events/releases{/id}","deployments_url":"https://api.github.com/repos/black-bullet/rock-events/deployments","created_at":"2016-01-14T13:04:44Z","updated_at":"2016-01-28T12:59:41Z","pushed_at":"2016-02-03T12:29:28Z","git_url":"git://github.com/black-bullet/rock-events.git","ssh_url":"git@github.com:black-bullet/rock-events.git","clone_url":"https://github.com/black-bullet/rock-events.git","svn_url":"https://github.com/black-bullet/rock-events","homepage":null,"size":623,"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":"stfalcon-studio:develop","ref":"develop","sha":"b92ce0065f3038c5e0cc54ec53177af6ec585cb7","user":{"login":"stfalcon-studio","id":814925,"avatar_url":"https://avatars.githubusercontent.com/u/814925?v=3","gravatar_id":"","url":"https://api.github.com/users/stfalcon-studio","html_url":"https://github.com/stfalcon-studio","followers_url":"https://api.github.com/users/stfalcon-studio/followers","following_url":"https://api.github.com/users/stfalcon-studio/following{/other_user}","gists_url":"https://api.github.com/users/stfalcon-studio/gists{/gist_id}","starred_url":"https://api.github.com/users/stfalcon-studio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stfalcon-studio/subscriptions","organizations_url":"https://api.github.com/users/stfalcon-studio/orgs","repos_url":"https://api.github.com/users/stfalcon-studio/repos","events_url":"https://api.github.com/users/stfalcon-studio/events{/privacy}","received_events_url":"https://api.github.com/users/stfalcon-studio/received_events","type":"Organization","site_admin":false},"repo":{"id":49646710,"name":"rock-events","full_name":"stfalcon-studio/rock-events","owner":{"login":"stfalcon-studio","id":814925,"avatar_url":"https://avatars.githubusercontent.com/u/814925?v=3","gravatar_id":"","url":"https://api.github.com/users/stfalcon-studio","html_url":"https://github.com/stfalcon-studio","followers_url":"https://api.github.com/users/stfalcon-studio/followers","following_url":"https://api.github.com/users/stfalcon-studio/following{/other_user}","gists_url":"https://api.github.com/users/stfalcon-studio/gists{/gist_id}","starred_url":"https://api.github.com/users/stfalcon-studio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stfalcon-studio/subscriptions","organizations_url":"https://api.github.com/users/stfalcon-studio/orgs","repos_url":"https://api.github.com/users/stfalcon-studio/repos","events_url":"https://api.github.com/users/stfalcon-studio/events{/privacy}","received_events_url":"https://api.github.com/users/stfalcon-studio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stfalcon-studio/rock-events","description":"","fork":false,"url":"https://api.github.com/repos/stfalcon-studio/rock-events","forks_url":"https://api.github.com/repos/stfalcon-studio/rock-events/forks","keys_url":"https://api.github.com/repos/stfalcon-studio/rock-events/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stfalcon-studio/rock-events/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stfalcon-studio/rock-events/teams","hooks_url":"https://api.github.com/repos/stfalcon-studio/rock-events/hooks","issue_events_url":"https://api.github.com/repos/stfalcon-studio/rock-events/issues/events{/number}","events_url":"https://api.github.com/repos/stfalcon-studio/rock-events/events","assignees_url":"https://api.github.com/repos/stfalcon-studio/rock-events/assignees{/user}","branches_url":"https://api.github.com/repos/stfalcon-studio/rock-events/branches{/branch}","tags_url":"https://api.github.com/repos/stfalcon-studio/rock-events/tags","blobs_url":"https://api.github.com/repos/stfalcon-studio/rock-events/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stfalcon-studio/rock-events/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stfalcon-studio/rock-events/git/refs{/sha}","trees_url":"https://api.github.com/repos/stfalcon-studio/rock-events/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stfalcon-studio/rock-events/statuses/{sha}","languages_url":"https://api.github.com/repos/stfalcon-studio/rock-events/languages","stargazers_url":"https://api.github.com/repos/stfalcon-studio/rock-events/stargazers","contributors_url":"https://api.github.com/repos/stfalcon-studio/rock-events/contributors","subscribers_url":"https://api.github.com/repos/stfalcon-studio/rock-events/subscribers","subscription_url":"https://api.github.com/repos/stfalcon-studio/rock-events/subscription","commits_url":"https://api.github.com/repos/stfalcon-studio/rock-events/commits{/sha}","git_commits_url":"https://api.github.com/repos/stfalcon-studio/rock-events/git/commits{/sha}","comments_url":"https://api.github.com/repos/stfalcon-studio/rock-events/comments{/number}","issue_comment_url":"https://api.github.com/repos/stfalcon-studio/rock-events/issues/comments{/number}","contents_url":"https://api.github.com/repos/stfalcon-studio/rock-events/contents/{+path}","compare_url":"https://api.github.com/repos/stfalcon-studio/rock-events/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stfalcon-studio/rock-events/merges","archive_url":"https://api.github.com/repos/stfalcon-studio/rock-events/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stfalcon-studio/rock-events/downloads","issues_url":"https://api.github.com/repos/stfalcon-studio/rock-events/issues{/number}","pulls_url":"https://api.github.com/repos/stfalcon-studio/rock-events/pulls{/number}","milestones_url":"https://api.github.com/repos/stfalcon-studio/rock-events/milestones{/number}","notifications_url":"https://api.github.com/repos/stfalcon-studio/rock-events/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stfalcon-studio/rock-events/labels{/name}","releases_url":"https://api.github.com/repos/stfalcon-studio/rock-events/releases{/id}","deployments_url":"https://api.github.com/repos/stfalcon-studio/rock-events/deployments","created_at":"2016-01-14T12:44:04Z","updated_at":"2016-01-19T09:26:01Z","pushed_at":"2016-02-03T12:32:02Z","git_url":"git://github.com/stfalcon-studio/rock-events.git","ssh_url":"git@github.com:stfalcon-studio/rock-events.git","clone_url":"https://github.com/stfalcon-studio/rock-events.git","svn_url":"https://github.com/stfalcon-studio/rock-events","homepage":null,"size":440,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stfalcon-studio/rock-events/pulls/22"},"html":{"href":"https://github.com/stfalcon-studio/rock-events/pull/22"},"issue":{"href":"https://api.github.com/repos/stfalcon-studio/rock-events/issues/22"},"comments":{"href":"https://api.github.com/repos/stfalcon-studio/rock-events/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/stfalcon-studio/rock-events/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/stfalcon-studio/rock-events/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stfalcon-studio/rock-events/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/stfalcon-studio/rock-events/statuses/5d77cf0f1885a9e85cea02a226e88b1f000d41ed"}}}}