{"action":"created","comment":{"url":"https://api.github.com/repos/bobthecow/psysh/pulls/comments/64075859","id":64075859,"diff_hunk":"@@ -0,0 +1,107 @@\n+<?php\n+\n+/*\n+ * This file is part of Psy Shell.\n+ *\n+ * (c) 2012-2015 Justin Hileman\n+ *\n+ * For the full copyright and license information, please view the LICENSE\n+ * file that was distributed with this source code.\n+ */\n+\n+namespace Psy\\Readline;\n+\n+use Hoa\\Console\\Readline\\Readline as HoaReadline;\n+use Psy\\Exception\\BreakException;\n+\n+/**\n+ * Hoa\\Console Readline implementation.\n+ */\n+class HoaConsole implements Readline\n+{\n+    /** @var HoaReadline */\n+    private $hoaReadline;\n+\n+    /**\n+     * @return bool\n+     */\n+    public static function isSupported()\n+    {\n+        return class_exists('\\Hoa\\Console\\Console', true);\n+    }\n+\n+    public function __construct()\n+    {\n+        $this->hoaReadline = new HoaReadline();\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function addHistory($line)\n+    {\n+        $this->hoaReadline->addHistory($line);\n+\n+        return true;\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function clearHistory()\n+    {\n+        $this->hoaReadline->clearHistory();\n+\n+        return true;\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function listHistory()\n+    {\n+        $i = 0;\n+        $list = array();\n+        while (($item = $this->hoaReadline->getHistory($i++)) !== null) {\n+            $list[] = $item;\n+        }\n+\n+        return $list;\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function readHistory()\n+    {\n+        return true;\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     *\n+     * @throws BreakException if user hits Ctrl+D\n+     *\n+     * @return string\n+     */\n+    public function readline($prompt = null)\n+    {\n+        return $this->hoaReadline->readLine($prompt);\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function redisplay()\n+    {\n+        // noop","path":"src/Psy/Readline/HoaConsole.php","position":97,"original_position":97,"commit_id":"87cb44dbaa332d54bddad0c2e9890a1918d8525d","original_commit_id":"87cb44dbaa332d54bddad0c2e9890a1918d8525d","user":{"login":"bobthecow","id":53660,"avatar_url":"https://avatars.githubusercontent.com/u/53660?v=3","gravatar_id":"","url":"https://api.github.com/users/bobthecow","html_url":"https://github.com/bobthecow","followers_url":"https://api.github.com/users/bobthecow/followers","following_url":"https://api.github.com/users/bobthecow/following{/other_user}","gists_url":"https://api.github.com/users/bobthecow/gists{/gist_id}","starred_url":"https://api.github.com/users/bobthecow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobthecow/subscriptions","organizations_url":"https://api.github.com/users/bobthecow/orgs","repos_url":"https://api.github.com/users/bobthecow/repos","events_url":"https://api.github.com/users/bobthecow/events{/privacy}","received_events_url":"https://api.github.com/users/bobthecow/received_events","type":"User","site_admin":false},"body":"`Psy\\Readline` is an abstraction over the whole readline API. But `redisplay` isn't _currently_ used in PsySH, so it's more there for completeness than anything else. If Hoa\\Console supports it and it's trivial, we should add it for if/whenever PsySH needs to use that.","created_at":"2016-05-20T17:17:15Z","updated_at":"2016-05-20T17:17:15Z","html_url":"https://github.com/bobthecow/psysh/pull/300#discussion_r64075859","pull_request_url":"https://api.github.com/repos/bobthecow/psysh/pulls/300","_links":{"self":{"href":"https://api.github.com/repos/bobthecow/psysh/pulls/comments/64075859"},"html":{"href":"https://github.com/bobthecow/psysh/pull/300#discussion_r64075859"},"pull_request":{"href":"https://api.github.com/repos/bobthecow/psysh/pulls/300"}}},"pull_request":{"url":"https://api.github.com/repos/bobthecow/psysh/pulls/300","id":66205069,"html_url":"https://github.com/bobthecow/psysh/pull/300","diff_url":"https://github.com/bobthecow/psysh/pull/300.diff","patch_url":"https://github.com/bobthecow/psysh/pull/300.patch","issue_url":"https://api.github.com/repos/bobthecow/psysh/issues/300","number":300,"state":"closed","locked":false,"title":"Add HoaConsole readline implementation","user":{"login":"zonuexe","id":822086,"avatar_url":"https://avatars.githubusercontent.com/u/822086?v=3","gravatar_id":"","url":"https://api.github.com/users/zonuexe","html_url":"https://github.com/zonuexe","followers_url":"https://api.github.com/users/zonuexe/followers","following_url":"https://api.github.com/users/zonuexe/following{/other_user}","gists_url":"https://api.github.com/users/zonuexe/gists{/gist_id}","starred_url":"https://api.github.com/users/zonuexe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zonuexe/subscriptions","organizations_url":"https://api.github.com/users/zonuexe/orgs","repos_url":"https://api.github.com/users/zonuexe/repos","events_url":"https://api.github.com/users/zonuexe/events{/privacy}","received_events_url":"https://api.github.com/users/zonuexe/received_events","type":"User","site_admin":false},"body":"[hoaproject/Console: The Hoa\\Console library.](https://github.com/hoaproject/Console)\r\n\r\nPure PHP readline implementation.","created_at":"2016-04-12T18:28:18Z","updated_at":"2016-05-20T17:17:15Z","closed_at":"2016-05-19T15:25:36Z","merged_at":"2016-05-19T15:25:36Z","merge_commit_sha":"1fac3508eb3a284dfc8a9bb9691b498444626aee","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bobthecow/psysh/pulls/300/commits","review_comments_url":"https://api.github.com/repos/bobthecow/psysh/pulls/300/comments","review_comment_url":"https://api.github.com/repos/bobthecow/psysh/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bobthecow/psysh/issues/300/comments","statuses_url":"https://api.github.com/repos/bobthecow/psysh/statuses/87cb44dbaa332d54bddad0c2e9890a1918d8525d","head":{"label":"zonuexe:feature/hoa-console","ref":"feature/hoa-console","sha":"87cb44dbaa332d54bddad0c2e9890a1918d8525d","user":{"login":"zonuexe","id":822086,"avatar_url":"https://avatars.githubusercontent.com/u/822086?v=3","gravatar_id":"","url":"https://api.github.com/users/zonuexe","html_url":"https://github.com/zonuexe","followers_url":"https://api.github.com/users/zonuexe/followers","following_url":"https://api.github.com/users/zonuexe/following{/other_user}","gists_url":"https://api.github.com/users/zonuexe/gists{/gist_id}","starred_url":"https://api.github.com/users/zonuexe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zonuexe/subscriptions","organizations_url":"https://api.github.com/users/zonuexe/orgs","repos_url":"https://api.github.com/users/zonuexe/repos","events_url":"https://api.github.com/users/zonuexe/events{/privacy}","received_events_url":"https://api.github.com/users/zonuexe/received_events","type":"User","site_admin":false},"repo":{"id":56079224,"name":"psysh","full_name":"zonuexe/psysh","owner":{"login":"zonuexe","id":822086,"avatar_url":"https://avatars.githubusercontent.com/u/822086?v=3","gravatar_id":"","url":"https://api.github.com/users/zonuexe","html_url":"https://github.com/zonuexe","followers_url":"https://api.github.com/users/zonuexe/followers","following_url":"https://api.github.com/users/zonuexe/following{/other_user}","gists_url":"https://api.github.com/users/zonuexe/gists{/gist_id}","starred_url":"https://api.github.com/users/zonuexe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zonuexe/subscriptions","organizations_url":"https://api.github.com/users/zonuexe/orgs","repos_url":"https://api.github.com/users/zonuexe/repos","events_url":"https://api.github.com/users/zonuexe/events{/privacy}","received_events_url":"https://api.github.com/users/zonuexe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zonuexe/psysh","description":"A REPL for PHP","fork":true,"url":"https://api.github.com/repos/zonuexe/psysh","forks_url":"https://api.github.com/repos/zonuexe/psysh/forks","keys_url":"https://api.github.com/repos/zonuexe/psysh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zonuexe/psysh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zonuexe/psysh/teams","hooks_url":"https://api.github.com/repos/zonuexe/psysh/hooks","issue_events_url":"https://api.github.com/repos/zonuexe/psysh/issues/events{/number}","events_url":"https://api.github.com/repos/zonuexe/psysh/events","assignees_url":"https://api.github.com/repos/zonuexe/psysh/assignees{/user}","branches_url":"https://api.github.com/repos/zonuexe/psysh/branches{/branch}","tags_url":"https://api.github.com/repos/zonuexe/psysh/tags","blobs_url":"https://api.github.com/repos/zonuexe/psysh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zonuexe/psysh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zonuexe/psysh/git/refs{/sha}","trees_url":"https://api.github.com/repos/zonuexe/psysh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zonuexe/psysh/statuses/{sha}","languages_url":"https://api.github.com/repos/zonuexe/psysh/languages","stargazers_url":"https://api.github.com/repos/zonuexe/psysh/stargazers","contributors_url":"https://api.github.com/repos/zonuexe/psysh/contributors","subscribers_url":"https://api.github.com/repos/zonuexe/psysh/subscribers","subscription_url":"https://api.github.com/repos/zonuexe/psysh/subscription","commits_url":"https://api.github.com/repos/zonuexe/psysh/commits{/sha}","git_commits_url":"https://api.github.com/repos/zonuexe/psysh/git/commits{/sha}","comments_url":"https://api.github.com/repos/zonuexe/psysh/comments{/number}","issue_comment_url":"https://api.github.com/repos/zonuexe/psysh/issues/comments{/number}","contents_url":"https://api.github.com/repos/zonuexe/psysh/contents/{+path}","compare_url":"https://api.github.com/repos/zonuexe/psysh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zonuexe/psysh/merges","archive_url":"https://api.github.com/repos/zonuexe/psysh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zonuexe/psysh/downloads","issues_url":"https://api.github.com/repos/zonuexe/psysh/issues{/number}","pulls_url":"https://api.github.com/repos/zonuexe/psysh/pulls{/number}","milestones_url":"https://api.github.com/repos/zonuexe/psysh/milestones{/number}","notifications_url":"https://api.github.com/repos/zonuexe/psysh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zonuexe/psysh/labels{/name}","releases_url":"https://api.github.com/repos/zonuexe/psysh/releases{/id}","deployments_url":"https://api.github.com/repos/zonuexe/psysh/deployments","created_at":"2016-04-12T16:19:31Z","updated_at":"2016-04-12T16:19:32Z","pushed_at":"2016-05-19T15:54:33Z","git_url":"git://github.com/zonuexe/psysh.git","ssh_url":"git@github.com:zonuexe/psysh.git","clone_url":"https://github.com/zonuexe/psysh.git","svn_url":"https://github.com/zonuexe/psysh","homepage":"http://psysh.org","size":53615,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"bobthecow:develop","ref":"develop","sha":"93074c85dac53591760a041a628b43b9453a9dff","user":{"login":"bobthecow","id":53660,"avatar_url":"https://avatars.githubusercontent.com/u/53660?v=3","gravatar_id":"","url":"https://api.github.com/users/bobthecow","html_url":"https://github.com/bobthecow","followers_url":"https://api.github.com/users/bobthecow/followers","following_url":"https://api.github.com/users/bobthecow/following{/other_user}","gists_url":"https://api.github.com/users/bobthecow/gists{/gist_id}","starred_url":"https://api.github.com/users/bobthecow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobthecow/subscriptions","organizations_url":"https://api.github.com/users/bobthecow/orgs","repos_url":"https://api.github.com/users/bobthecow/repos","events_url":"https://api.github.com/users/bobthecow/events{/privacy}","received_events_url":"https://api.github.com/users/bobthecow/received_events","type":"User","site_admin":false},"repo":{"id":4549925,"name":"psysh","full_name":"bobthecow/psysh","owner":{"login":"bobthecow","id":53660,"avatar_url":"https://avatars.githubusercontent.com/u/53660?v=3","gravatar_id":"","url":"https://api.github.com/users/bobthecow","html_url":"https://github.com/bobthecow","followers_url":"https://api.github.com/users/bobthecow/followers","following_url":"https://api.github.com/users/bobthecow/following{/other_user}","gists_url":"https://api.github.com/users/bobthecow/gists{/gist_id}","starred_url":"https://api.github.com/users/bobthecow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobthecow/subscriptions","organizations_url":"https://api.github.com/users/bobthecow/orgs","repos_url":"https://api.github.com/users/bobthecow/repos","events_url":"https://api.github.com/users/bobthecow/events{/privacy}","received_events_url":"https://api.github.com/users/bobthecow/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bobthecow/psysh","description":"A REPL for PHP","fork":false,"url":"https://api.github.com/repos/bobthecow/psysh","forks_url":"https://api.github.com/repos/bobthecow/psysh/forks","keys_url":"https://api.github.com/repos/bobthecow/psysh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bobthecow/psysh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bobthecow/psysh/teams","hooks_url":"https://api.github.com/repos/bobthecow/psysh/hooks","issue_events_url":"https://api.github.com/repos/bobthecow/psysh/issues/events{/number}","events_url":"https://api.github.com/repos/bobthecow/psysh/events","assignees_url":"https://api.github.com/repos/bobthecow/psysh/assignees{/user}","branches_url":"https://api.github.com/repos/bobthecow/psysh/branches{/branch}","tags_url":"https://api.github.com/repos/bobthecow/psysh/tags","blobs_url":"https://api.github.com/repos/bobthecow/psysh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bobthecow/psysh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bobthecow/psysh/git/refs{/sha}","trees_url":"https://api.github.com/repos/bobthecow/psysh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bobthecow/psysh/statuses/{sha}","languages_url":"https://api.github.com/repos/bobthecow/psysh/languages","stargazers_url":"https://api.github.com/repos/bobthecow/psysh/stargazers","contributors_url":"https://api.github.com/repos/bobthecow/psysh/contributors","subscribers_url":"https://api.github.com/repos/bobthecow/psysh/subscribers","subscription_url":"https://api.github.com/repos/bobthecow/psysh/subscription","commits_url":"https://api.github.com/repos/bobthecow/psysh/commits{/sha}","git_commits_url":"https://api.github.com/repos/bobthecow/psysh/git/commits{/sha}","comments_url":"https://api.github.com/repos/bobthecow/psysh/comments{/number}","issue_comment_url":"https://api.github.com/repos/bobthecow/psysh/issues/comments{/number}","contents_url":"https://api.github.com/repos/bobthecow/psysh/contents/{+path}","compare_url":"https://api.github.com/repos/bobthecow/psysh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bobthecow/psysh/merges","archive_url":"https://api.github.com/repos/bobthecow/psysh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bobthecow/psysh/downloads","issues_url":"https://api.github.com/repos/bobthecow/psysh/issues{/number}","pulls_url":"https://api.github.com/repos/bobthecow/psysh/pulls{/number}","milestones_url":"https://api.github.com/repos/bobthecow/psysh/milestones{/number}","notifications_url":"https://api.github.com/repos/bobthecow/psysh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bobthecow/psysh/labels{/name}","releases_url":"https://api.github.com/repos/bobthecow/psysh/releases{/id}","deployments_url":"https://api.github.com/repos/bobthecow/psysh/deployments","created_at":"2012-06-04T17:15:35Z","updated_at":"2016-05-20T09:30:51Z","pushed_at":"2016-05-19T15:25:36Z","git_url":"git://github.com/bobthecow/psysh.git","ssh_url":"git@github.com:bobthecow/psysh.git","clone_url":"https://github.com/bobthecow/psysh.git","svn_url":"https://github.com/bobthecow/psysh","homepage":"http://psysh.org","size":53778,"stargazers_count":1386,"watchers_count":1386,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":118,"mirror_url":null,"open_issues_count":51,"forks":118,"open_issues":51,"watchers":1386,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bobthecow/psysh/pulls/300"},"html":{"href":"https://github.com/bobthecow/psysh/pull/300"},"issue":{"href":"https://api.github.com/repos/bobthecow/psysh/issues/300"},"comments":{"href":"https://api.github.com/repos/bobthecow/psysh/issues/300/comments"},"review_comments":{"href":"https://api.github.com/repos/bobthecow/psysh/pulls/300/comments"},"review_comment":{"href":"https://api.github.com/repos/bobthecow/psysh/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bobthecow/psysh/pulls/300/commits"},"statuses":{"href":"https://api.github.com/repos/bobthecow/psysh/statuses/87cb44dbaa332d54bddad0c2e9890a1918d8525d"}}}}
{"actor":{"display_login":"bobthecow"}}