GitHub PullRequestReviewCommentEvent at 2014-11-26 22:48:40
Repository: UserCore
Actor: Ocramius
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/Roave/UserCore/pulls/comments/20969030","id":20969030,"diff_hunk":"@@ -0,0 +1,154 @@\n+<?php\n+/**\n+ * Copyright (c) 2014 Roave, LLC.\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions\n+ * are met:\n+ *\n+ *   * Redistributions of source code must retain the above copyright\n+ *     notice, this list of conditions and the following disclaimer.\n+ *\n+ *   * Redistributions in binary form must reproduce the above copyright\n+ *     notice, this list of conditions and the following disclaimer in\n+ *     the documentation and/or other materials provided with the\n+ *     distribution.\n+ *\n+ *   * Neither the names of the copyright holders nor the names of the\n+ *     contributors may be used to endorse or promote products derived\n+ *     from this software without specific prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ *\n+ * @copyright 2014 Roave, LLC\n+ * @license   http://www.opensource.org/licenses/bsd-license.php  BSD License\n+ */\n+\n+namespace Roave\\User\\Core\\Controller;\n+\n+use BaconAuthentication\\AuthenticationServiceInterface;\n+use Roave\\User\\Core\\Options\\AuthenticationOptions;\n+use Zend\\Form\\FormInterface;\n+use Zend\\Http\\Response;\n+use Zend\\Mvc\\Controller\\AbstractActionController;\n+use Zend\\View\\Model\\ViewModel;\n+\n+/**\n+ * Class AuthenticationController\n+ *\n+ * @method \\Zend\\Http\\Request getRequest\n+ * @method \\Zend\\Http\\Response getResponse\n+ */\n+class AuthenticationController extends AbstractActionController\n+{\n+    const FLASH_MESSENGER_NAMESPACE = __CLASS__;\n+\n+    /**\n+     * @var FormInterface\n+     */\n+    private $form;\n+\n+    /**\n+     * @var AuthenticationOptions\n+     */\n+    private $options;\n+\n+    /**\n+     * @var AuthenticationServiceInterface\n+     */\n+    private $authenticationService;\n+\n+    /**\n+     * @param AuthenticationOptions          $options\n+     * @param FormInterface                  $form\n+     * @param AuthenticationServiceInterface $authenticationService\n+     */\n+    public function __construct(\n+        AuthenticationOptions $options,\n+        FormInterface $form,\n+        AuthenticationServiceInterface $authenticationService\n+    ) {\n+        $this->form                  = $form;\n+        $this->options               = $options;\n+        $this->authenticationService = $authenticationService;\n+    }\n+\n+    /**\n+     * Display the standard login form\n+     *\n+     * @return ViewModel\n+     */\n+    public function indexAction()\n+    {\n+        $this->form->setAttribute('method', 'POST');\n+        $this->form->setAttribute('action', $this->url()->fromRoute($this->options->getAuthenticationRoute()));\n+\n+        $model = new ViewModel();\n+        $model->setTemplate($this->options->getLoginTemplate());\n+        $model->setVariable('form', $this->form);\n+\n+        return $model;\n+    }\n+\n+    /**\n+     * Attempt to authenticate the user\n+     *\n+     * @return Response\n+     */\n+    public function authenticateAction()\n+    {\n+        $result = $this->authenticationService->authenticate($this->getRequest(), $this->getResponse());\n+\n+        if ($result->isChallenge()) {\n+            return $this->getResponse();\n+        }\n+\n+        if ($result->isFailure()) {\n+\n+            $this\n+                ->flashMessenger()\n+                ->setNamespace(static::FLASH_MESSENGER_NAMESPACE)\n+                ->addMessage($result->getPayload()->getMessage());\n+\n+            return $this->redirect()->toRoute($this->options->getLoginRoute());\n+        }\n+\n+        $redirect = $this->getRequest()->getQuery($this->options->getRedirectField());\n+        if ($redirect) {\n+            return $this->redirect()->toUrl($redirect);\n+        }\n+\n+        return $this->redirect()->toRoute($this->options->getLoginRedirectToRoute());\n+    }\n+\n+    /**\n+     * Reset the users session\n+     *\n+     * @return ViewModel|Response\n+     */\n+    public function logoutAction()","path":"src/Roave/User/Core/Controller/AuthenticationController.php","position":141,"original_position":141,"commit_id":"dde66aa717af4b4f4680e6f73352d2bf9618eef3","original_commit_id":"dde66aa717af4b4f4680e6f73352d2bf9618eef3","user":{"login":"Ocramius","id":154256,"avatar_url":"https://avatars.githubusercontent.com/u/154256?v=3","gravatar_id":"","url":"https://api.github.com/users/Ocramius","html_url":"https://github.com/Ocramius","followers_url":"https://api.github.com/users/Ocramius/followers","following_url":"https://api.github.com/users/Ocramius/following{/other_user}","gists_url":"https://api.github.com/users/Ocramius/gists{/gist_id}","starred_url":"https://api.github.com/users/Ocramius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ocramius/subscriptions","organizations_url":"https://api.github.com/users/Ocramius/orgs","repos_url":"https://api.github.com/users/Ocramius/repos","events_url":"https://api.github.com/users/Ocramius/events{/privacy}","received_events_url":"https://api.github.com/users/Ocramius/received_events","type":"User","site_admin":false},"body":"Based on the fact that you have two separate unrelated actions going on here, with very different dependency requirements :-)\r\nThey are not logically grouped IMO","created_at":"2014-11-26T22:48:40Z","updated_at":"2014-11-26T22:48:40Z","html_url":"https://github.com/Roave/UserCore/pull/2#discussion_r20969030","pull_request_url":"https://api.github.com/repos/Roave/UserCore/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/Roave/UserCore/pulls/comments/20969030"},"html":{"href":"https://github.com/Roave/UserCore/pull/2#discussion_r20969030"},"pull_request":{"href":"https://api.github.com/repos/Roave/UserCore/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/Roave/UserCore/pulls/2","id":24685976,"html_url":"https://github.com/Roave/UserCore/pull/2","diff_url":"https://github.com/Roave/UserCore/pull/2.diff","patch_url":"https://github.com/Roave/UserCore/pull/2.patch","issue_url":"https://api.github.com/repos/Roave/UserCore/issues/2","number":2,"state":"open","locked":false,"title":"Base implementation","user":{"login":"macnibblet","id":1127626,"avatar_url":"https://avatars.githubusercontent.com/u/1127626?v=3","gravatar_id":"","url":"https://api.github.com/users/macnibblet","html_url":"https://github.com/macnibblet","followers_url":"https://api.github.com/users/macnibblet/followers","following_url":"https://api.github.com/users/macnibblet/following{/other_user}","gists_url":"https://api.github.com/users/macnibblet/gists{/gist_id}","starred_url":"https://api.github.com/users/macnibblet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macnibblet/subscriptions","organizations_url":"https://api.github.com/users/macnibblet/orgs","repos_url":"https://api.github.com/users/macnibblet/repos","events_url":"https://api.github.com/users/macnibblet/events{/privacy}","received_events_url":"https://api.github.com/users/macnibblet/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-11-19T12:53:51Z","updated_at":"2014-11-26T22:48:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"420b4372e24a13eaf63750ca8e207643780efd33","assignee":{"login":"Ocramius","id":154256,"avatar_url":"https://avatars.githubusercontent.com/u/154256?v=3","gravatar_id":"","url":"https://api.github.com/users/Ocramius","html_url":"https://github.com/Ocramius","followers_url":"https://api.github.com/users/Ocramius/followers","following_url":"https://api.github.com/users/Ocramius/following{/other_user}","gists_url":"https://api.github.com/users/Ocramius/gists{/gist_id}","starred_url":"https://api.github.com/users/Ocramius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ocramius/subscriptions","organizations_url":"https://api.github.com/users/Ocramius/orgs","repos_url":"https://api.github.com/users/Ocramius/repos","events_url":"https://api.github.com/users/Ocramius/events{/privacy}","received_events_url":"https://api.github.com/users/Ocramius/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Roave/UserCore/pulls/2/commits","review_comments_url":"https://api.github.com/repos/Roave/UserCore/pulls/2/comments","review_comment_url":"https://api.github.com/repos/Roave/UserCore/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Roave/UserCore/issues/2/comments","statuses_url":"https://api.github.com/repos/Roave/UserCore/statuses/dde66aa717af4b4f4680e6f73352d2bf9618eef3","head":{"label":"Roave:develop","ref":"develop","sha":"dde66aa717af4b4f4680e6f73352d2bf9618eef3","user":{"login":"Roave","id":3029050,"avatar_url":"https://avatars.githubusercontent.com/u/3029050?v=3","gravatar_id":"","url":"https://api.github.com/users/Roave","html_url":"https://github.com/Roave","followers_url":"https://api.github.com/users/Roave/followers","following_url":"https://api.github.com/users/Roave/following{/other_user}","gists_url":"https://api.github.com/users/Roave/gists{/gist_id}","starred_url":"https://api.github.com/users/Roave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Roave/subscriptions","organizations_url":"https://api.github.com/users/Roave/orgs","repos_url":"https://api.github.com/users/Roave/repos","events_url":"https://api.github.com/users/Roave/events{/privacy}","received_events_url":"https://api.github.com/users/Roave/received_events","type":"Organization","site_admin":false},"repo":{"id":26810268,"name":"UserCore","full_name":"Roave/UserCore","owner":{"login":"Roave","id":3029050,"avatar_url":"https://avatars.githubusercontent.com/u/3029050?v=3","gravatar_id":"","url":"https://api.github.com/users/Roave","html_url":"https://github.com/Roave","followers_url":"https://api.github.com/users/Roave/followers","following_url":"https://api.github.com/users/Roave/following{/other_user}","gists_url":"https://api.github.com/users/Roave/gists{/gist_id}","starred_url":"https://api.github.com/users/Roave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Roave/subscriptions","organizations_url":"https://api.github.com/users/Roave/orgs","repos_url":"https://api.github.com/users/Roave/repos","events_url":"https://api.github.com/users/Roave/events{/privacy}","received_events_url":"https://api.github.com/users/Roave/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Roave/UserCore","description":"[WIP] Generic user module","fork":false,"url":"https://api.github.com/repos/Roave/UserCore","forks_url":"https://api.github.com/repos/Roave/UserCore/forks","keys_url":"https://api.github.com/repos/Roave/UserCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Roave/UserCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Roave/UserCore/teams","hooks_url":"https://api.github.com/repos/Roave/UserCore/hooks","issue_events_url":"https://api.github.com/repos/Roave/UserCore/issues/events{/number}","events_url":"https://api.github.com/repos/Roave/UserCore/events","assignees_url":"https://api.github.com/repos/Roave/UserCore/assignees{/user}","branches_url":"https://api.github.com/repos/Roave/UserCore/branches{/branch}","tags_url":"https://api.github.com/repos/Roave/UserCore/tags","blobs_url":"https://api.github.com/repos/Roave/UserCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Roave/UserCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Roave/UserCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/Roave/UserCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Roave/UserCore/statuses/{sha}","languages_url":"https://api.github.com/repos/Roave/UserCore/languages","stargazers_url":"https://api.github.com/repos/Roave/UserCore/stargazers","contributors_url":"https://api.github.com/repos/Roave/UserCore/contributors","subscribers_url":"https://api.github.com/repos/Roave/UserCore/subscribers","subscription_url":"https://api.github.com/repos/Roave/UserCore/subscription","commits_url":"https://api.github.com/repos/Roave/UserCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/Roave/UserCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/Roave/UserCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/Roave/UserCore/issues/comments/{number}","contents_url":"https://api.github.com/repos/Roave/UserCore/contents/{+path}","compare_url":"https://api.github.com/repos/Roave/UserCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Roave/UserCore/merges","archive_url":"https://api.github.com/repos/Roave/UserCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Roave/UserCore/downloads","issues_url":"https://api.github.com/repos/Roave/UserCore/issues{/number}","pulls_url":"https://api.github.com/repos/Roave/UserCore/pulls{/number}","milestones_url":"https://api.github.com/repos/Roave/UserCore/milestones{/number}","notifications_url":"https://api.github.com/repos/Roave/UserCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Roave/UserCore/labels{/name}","releases_url":"https://api.github.com/repos/Roave/UserCore/releases{/id}","created_at":"2014-11-18T13:24:36Z","updated_at":"2014-11-22T16:12:38Z","pushed_at":"2014-11-24T14:05:19Z","git_url":"git://github.com/Roave/UserCore.git","ssh_url":"git@github.com:Roave/UserCore.git","clone_url":"https://github.com/Roave/UserCore.git","svn_url":"https://github.com/Roave/UserCore","homepage":null,"size":567,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"Roave:master","ref":"master","sha":"544b5209c4f1ae601bdf0ca1c5567cee74c4d129","user":{"login":"Roave","id":3029050,"avatar_url":"https://avatars.githubusercontent.com/u/3029050?v=3","gravatar_id":"","url":"https://api.github.com/users/Roave","html_url":"https://github.com/Roave","followers_url":"https://api.github.com/users/Roave/followers","following_url":"https://api.github.com/users/Roave/following{/other_user}","gists_url":"https://api.github.com/users/Roave/gists{/gist_id}","starred_url":"https://api.github.com/users/Roave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Roave/subscriptions","organizations_url":"https://api.github.com/users/Roave/orgs","repos_url":"https://api.github.com/users/Roave/repos","events_url":"https://api.github.com/users/Roave/events{/privacy}","received_events_url":"https://api.github.com/users/Roave/received_events","type":"Organization","site_admin":false},"repo":{"id":26810268,"name":"UserCore","full_name":"Roave/UserCore","owner":{"login":"Roave","id":3029050,"avatar_url":"https://avatars.githubusercontent.com/u/3029050?v=3","gravatar_id":"","url":"https://api.github.com/users/Roave","html_url":"https://github.com/Roave","followers_url":"https://api.github.com/users/Roave/followers","following_url":"https://api.github.com/users/Roave/following{/other_user}","gists_url":"https://api.github.com/users/Roave/gists{/gist_id}","starred_url":"https://api.github.com/users/Roave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Roave/subscriptions","organizations_url":"https://api.github.com/users/Roave/orgs","repos_url":"https://api.github.com/users/Roave/repos","events_url":"https://api.github.com/users/Roave/events{/privacy}","received_events_url":"https://api.github.com/users/Roave/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Roave/UserCore","description":"[WIP] Generic user module","fork":false,"url":"https://api.github.com/repos/Roave/UserCore","forks_url":"https://api.github.com/repos/Roave/UserCore/forks","keys_url":"https://api.github.com/repos/Roave/UserCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Roave/UserCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Roave/UserCore/teams","hooks_url":"https://api.github.com/repos/Roave/UserCore/hooks","issue_events_url":"https://api.github.com/repos/Roave/UserCore/issues/events{/number}","events_url":"https://api.github.com/repos/Roave/UserCore/events","assignees_url":"https://api.github.com/repos/Roave/UserCore/assignees{/user}","branches_url":"https://api.github.com/repos/Roave/UserCore/branches{/branch}","tags_url":"https://api.github.com/repos/Roave/UserCore/tags","blobs_url":"https://api.github.com/repos/Roave/UserCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Roave/UserCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Roave/UserCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/Roave/UserCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Roave/UserCore/statuses/{sha}","languages_url":"https://api.github.com/repos/Roave/UserCore/languages","stargazers_url":"https://api.github.com/repos/Roave/UserCore/stargazers","contributors_url":"https://api.github.com/repos/Roave/UserCore/contributors","subscribers_url":"https://api.github.com/repos/Roave/UserCore/subscribers","subscription_url":"https://api.github.com/repos/Roave/UserCore/subscription","commits_url":"https://api.github.com/repos/Roave/UserCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/Roave/UserCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/Roave/UserCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/Roave/UserCore/issues/comments/{number}","contents_url":"https://api.github.com/repos/Roave/UserCore/contents/{+path}","compare_url":"https://api.github.com/repos/Roave/UserCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Roave/UserCore/merges","archive_url":"https://api.github.com/repos/Roave/UserCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Roave/UserCore/downloads","issues_url":"https://api.github.com/repos/Roave/UserCore/issues{/number}","pulls_url":"https://api.github.com/repos/Roave/UserCore/pulls{/number}","milestones_url":"https://api.github.com/repos/Roave/UserCore/milestones{/number}","notifications_url":"https://api.github.com/repos/Roave/UserCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Roave/UserCore/labels{/name}","releases_url":"https://api.github.com/repos/Roave/UserCore/releases{/id}","created_at":"2014-11-18T13:24:36Z","updated_at":"2014-11-22T16:12:38Z","pushed_at":"2014-11-24T14:05:19Z","git_url":"git://github.com/Roave/UserCore.git","ssh_url":"git@github.com:Roave/UserCore.git","clone_url":"https://github.com/Roave/UserCore.git","svn_url":"https://github.com/Roave/UserCore","homepage":null,"size":567,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Roave/UserCore/pulls/2"},"html":{"href":"https://github.com/Roave/UserCore/pull/2"},"issue":{"href":"https://api.github.com/repos/Roave/UserCore/issues/2"},"comments":{"href":"https://api.github.com/repos/Roave/UserCore/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/Roave/UserCore/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/Roave/UserCore/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Roave/UserCore/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/Roave/UserCore/statuses/dde66aa717af4b4f4680e6f73352d2bf9618eef3"}}}}