{"action":"created","comment":{"url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/comments/47039664","id":47039664,"diff_hunk":"@@ -0,0 +1,51 @@\n+<?php\n+\n+namespace Telegram\\Bot\\HttpClients;\n+\n+class TestGuzzleHttpClient extends GuzzleHttpClient\n+{\n+    /** @var  int */\n+    protected $timeOut;\n+    /** @var  int */\n+    protected $connectTimeOut;\n+\n+    public function send(\n+        $url,\n+        $method,\n+        array $headers = [],\n+        array $options = [],\n+        $timeOut = 30,\n+        $isAsyncRequest = false,\n+        $connectTimeOut = 10\n+    ) {\n+        $this->timeOut = $timeOut;\n+        $this->connectTimeOut = $connectTimeOut;\n+\n+        return parent::send(\n+            $url,\n+            $method,\n+            $headers,\n+            $options,\n+            $timeOut,\n+            $isAsyncRequest,\n+            $connectTimeOut\n+        );\n+    }\n+\n+    /**\n+     * @return int|null\n+     */\n+    public function getTimeOut()\n+    {\n+        return $this->timeOut;\n+    }\n+\n+    /**\n+     * @return int|null\n+     */\n+    public function getConnectTimeOut()\n+    {\n+        return $this->connectTimeOut;\n+    }\n+\n+}","path":"src/HttpClients/TestGuzzleHttpClient.php","position":51,"original_position":51,"commit_id":"49cf650a8d9d7794b99c5a86f6103f199e969c2b","original_commit_id":"49cf650a8d9d7794b99c5a86f6103f199e969c2b","user":{"login":"Nitpick-CI","id":12626182,"avatar_url":"https://avatars.githubusercontent.com/u/12626182?v=3","gravatar_id":"","url":"https://api.github.com/users/Nitpick-CI","html_url":"https://github.com/Nitpick-CI","followers_url":"https://api.github.com/users/Nitpick-CI/followers","following_url":"https://api.github.com/users/Nitpick-CI/following{/other_user}","gists_url":"https://api.github.com/users/Nitpick-CI/gists{/gist_id}","starred_url":"https://api.github.com/users/Nitpick-CI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nitpick-CI/subscriptions","organizations_url":"https://api.github.com/users/Nitpick-CI/orgs","repos_url":"https://api.github.com/users/Nitpick-CI/repos","events_url":"https://api.github.com/users/Nitpick-CI/events{/privacy}","received_events_url":"https://api.github.com/users/Nitpick-CI/received_events","type":"User","site_admin":false},"body":"- Expected 1 newline at end of file; 0 found\n- The closing brace for the class must go on the next line after the body\n","created_at":"2015-12-09T01:06:48Z","updated_at":"2015-12-09T01:06:48Z","html_url":"https://github.com/irazasyed/telegram-bot-sdk/pull/80#discussion_r47039664","pull_request_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/80","_links":{"self":{"href":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/comments/47039664"},"html":{"href":"https://github.com/irazasyed/telegram-bot-sdk/pull/80#discussion_r47039664"},"pull_request":{"href":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/80"}}},"pull_request":{"url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/80","id":53063461,"html_url":"https://github.com/irazasyed/telegram-bot-sdk/pull/80","diff_url":"https://github.com/irazasyed/telegram-bot-sdk/pull/80.diff","patch_url":"https://github.com/irazasyed/telegram-bot-sdk/pull/80.patch","issue_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues/80","number":80,"state":"open","locked":false,"title":"Timeout and connection timeout setting ability added","user":{"login":"ihoru","id":361908,"avatar_url":"https://avatars.githubusercontent.com/u/361908?v=3","gravatar_id":"","url":"https://api.github.com/users/ihoru","html_url":"https://github.com/ihoru","followers_url":"https://api.github.com/users/ihoru/followers","following_url":"https://api.github.com/users/ihoru/following{/other_user}","gists_url":"https://api.github.com/users/ihoru/gists{/gist_id}","starred_url":"https://api.github.com/users/ihoru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ihoru/subscriptions","organizations_url":"https://api.github.com/users/ihoru/orgs","repos_url":"https://api.github.com/users/ihoru/repos","events_url":"https://api.github.com/users/ihoru/events{/privacy}","received_events_url":"https://api.github.com/users/ihoru/received_events","type":"User","site_admin":false},"body":"As I wrote in Gitter chat here are changes to give developer ability to pass request timeout to the HttpClient.\r\n\r\n1. How to use it?\r\nIn every method that makes request (getUpdates, sendVideo, sendMessage and all other) you can pass params: http_client_timeout and http_client_connect_timeout like here:\r\n```\r\n...->sendMessage(\r\n            [\r\n                'chat_id'                     => $chatId,\r\n                'text'                        => $text,\r\n                'http_client_timeout'         => 1,\r\n                'http_client_connect_timeout' => 1,\r\n            ]\r\n        );\r\n```\r\n2. In process of working on this changes I decided also to give ability to change connect_timeout (it also was constant in GuzzleHttpClient class)\r\n3. I added $connectTimeOut variable to the end of send method for backward compatibility.\r\n4. I created class TestGuzzleHttpClient that extends GuzzleHttpClient just for getting passed timeouts and check them in tests. I'm not sure in correct place of the file (I though to put it into tests dir, but there is just mocks now and no src or something like that...)\r\n5. I created tests for this ability","created_at":"2015-12-09T01:06:41Z","updated_at":"2015-12-09T01:06:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"63acd2a242aa618c1ee360d9a8acb72fde5ac2fa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/80/commits","review_comments_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/80/comments","review_comment_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues/80/comments","statuses_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/statuses/49cf650a8d9d7794b99c5a86f6103f199e969c2b","head":{"label":"ihoru:master","ref":"master","sha":"49cf650a8d9d7794b99c5a86f6103f199e969c2b","user":{"login":"ihoru","id":361908,"avatar_url":"https://avatars.githubusercontent.com/u/361908?v=3","gravatar_id":"","url":"https://api.github.com/users/ihoru","html_url":"https://github.com/ihoru","followers_url":"https://api.github.com/users/ihoru/followers","following_url":"https://api.github.com/users/ihoru/following{/other_user}","gists_url":"https://api.github.com/users/ihoru/gists{/gist_id}","starred_url":"https://api.github.com/users/ihoru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ihoru/subscriptions","organizations_url":"https://api.github.com/users/ihoru/orgs","repos_url":"https://api.github.com/users/ihoru/repos","events_url":"https://api.github.com/users/ihoru/events{/privacy}","received_events_url":"https://api.github.com/users/ihoru/received_events","type":"User","site_admin":false},"repo":{"id":47618581,"name":"telegram-bot-sdk","full_name":"ihoru/telegram-bot-sdk","owner":{"login":"ihoru","id":361908,"avatar_url":"https://avatars.githubusercontent.com/u/361908?v=3","gravatar_id":"","url":"https://api.github.com/users/ihoru","html_url":"https://github.com/ihoru","followers_url":"https://api.github.com/users/ihoru/followers","following_url":"https://api.github.com/users/ihoru/following{/other_user}","gists_url":"https://api.github.com/users/ihoru/gists{/gist_id}","starred_url":"https://api.github.com/users/ihoru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ihoru/subscriptions","organizations_url":"https://api.github.com/users/ihoru/orgs","repos_url":"https://api.github.com/users/ihoru/repos","events_url":"https://api.github.com/users/ihoru/events{/privacy}","received_events_url":"https://api.github.com/users/ihoru/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ihoru/telegram-bot-sdk","description":"The (Unofficial) Telegram Bot API PHP SDK. Lets you develop Telegram Bots easily! Supports Laravel out of the box.","fork":true,"url":"https://api.github.com/repos/ihoru/telegram-bot-sdk","forks_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/forks","keys_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/teams","hooks_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/hooks","issue_events_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/events","assignees_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/tags","blobs_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/languages","stargazers_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/stargazers","contributors_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/contributors","subscribers_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/subscribers","subscription_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/subscription","commits_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/merges","archive_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/downloads","issues_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/labels{/name}","releases_url":"https://api.github.com/repos/ihoru/telegram-bot-sdk/releases{/id}","created_at":"2015-12-08T11:41:54Z","updated_at":"2015-12-08T11:41:55Z","pushed_at":"2015-12-09T00:54:37Z","git_url":"git://github.com/ihoru/telegram-bot-sdk.git","ssh_url":"git@github.com:ihoru/telegram-bot-sdk.git","clone_url":"https://github.com/ihoru/telegram-bot-sdk.git","svn_url":"https://github.com/ihoru/telegram-bot-sdk","homepage":"https://irazasyed.github.io/telegram-bot-sdk/","size":836,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"irazasyed:master","ref":"master","sha":"df25680356e67f8605f7bd4d2c9cebe243fb9f76","user":{"login":"irazasyed","id":1915268,"avatar_url":"https://avatars.githubusercontent.com/u/1915268?v=3","gravatar_id":"","url":"https://api.github.com/users/irazasyed","html_url":"https://github.com/irazasyed","followers_url":"https://api.github.com/users/irazasyed/followers","following_url":"https://api.github.com/users/irazasyed/following{/other_user}","gists_url":"https://api.github.com/users/irazasyed/gists{/gist_id}","starred_url":"https://api.github.com/users/irazasyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irazasyed/subscriptions","organizations_url":"https://api.github.com/users/irazasyed/orgs","repos_url":"https://api.github.com/users/irazasyed/repos","events_url":"https://api.github.com/users/irazasyed/events{/privacy}","received_events_url":"https://api.github.com/users/irazasyed/received_events","type":"User","site_admin":false},"repo":{"id":38233033,"name":"telegram-bot-sdk","full_name":"irazasyed/telegram-bot-sdk","owner":{"login":"irazasyed","id":1915268,"avatar_url":"https://avatars.githubusercontent.com/u/1915268?v=3","gravatar_id":"","url":"https://api.github.com/users/irazasyed","html_url":"https://github.com/irazasyed","followers_url":"https://api.github.com/users/irazasyed/followers","following_url":"https://api.github.com/users/irazasyed/following{/other_user}","gists_url":"https://api.github.com/users/irazasyed/gists{/gist_id}","starred_url":"https://api.github.com/users/irazasyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irazasyed/subscriptions","organizations_url":"https://api.github.com/users/irazasyed/orgs","repos_url":"https://api.github.com/users/irazasyed/repos","events_url":"https://api.github.com/users/irazasyed/events{/privacy}","received_events_url":"https://api.github.com/users/irazasyed/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/irazasyed/telegram-bot-sdk","description":"The (Unofficial) Telegram Bot API PHP SDK. Lets you develop Telegram Bots easily! Supports Laravel out of the box.","fork":false,"url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk","forks_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/forks","keys_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/teams","hooks_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/hooks","issue_events_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/events","assignees_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/tags","blobs_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/languages","stargazers_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/stargazers","contributors_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/contributors","subscribers_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/subscribers","subscription_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/subscription","commits_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/merges","archive_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/downloads","issues_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/labels{/name}","releases_url":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/releases{/id}","created_at":"2015-06-29T07:12:35Z","updated_at":"2015-12-07T10:53:40Z","pushed_at":"2015-12-09T01:06:41Z","git_url":"git://github.com/irazasyed/telegram-bot-sdk.git","ssh_url":"git@github.com:irazasyed/telegram-bot-sdk.git","clone_url":"https://github.com/irazasyed/telegram-bot-sdk.git","svn_url":"https://github.com/irazasyed/telegram-bot-sdk","homepage":"https://irazasyed.github.io/telegram-bot-sdk/","size":856,"stargazers_count":196,"watchers_count":196,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":42,"mirror_url":null,"open_issues_count":7,"forks":42,"open_issues":7,"watchers":196,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/80"},"html":{"href":"https://github.com/irazasyed/telegram-bot-sdk/pull/80"},"issue":{"href":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues/80"},"comments":{"href":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/issues/80/comments"},"review_comments":{"href":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/80/comments"},"review_comment":{"href":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/pulls/80/commits"},"statuses":{"href":"https://api.github.com/repos/irazasyed/telegram-bot-sdk/statuses/49cf650a8d9d7794b99c5a86f6103f199e969c2b"}}}}