{"action":"created","comment":{"url":"https://api.github.com/repos/florianv/exchanger/pulls/comments/91669286","pull_request_review_id":12179529,"id":91669286,"diff_hunk":"@@ -0,0 +1,76 @@\n+<?php\n+\n+namespace Exchanger\\Service;\n+\n+use Exchanger\\Contract\\ExchangeRateQuery;\n+use Exchanger\\Contract\\HistoricalExchangeRateQuery;\n+use Exchanger\\Exception\\UnsupportedCurrencyPairException;\n+use Exchanger\\Exception\\UnsupportedDateException;\n+use Exchanger\\ExchangeRate;\n+use Exchanger\\Service\\HistoricalService;\n+use Exchanger\\StringUtil;\n+\n+/**\n+ * Russian Central Bank Service.\n+ *\n+ */\n+class RussianCentralBank extends HistoricalService\n+{\n+    const URL = 'http://www.cbr.ru/scripts/XML_daily.asp';\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    protected function getLatestExchangeRate(ExchangeRateQuery $exchangeQuery)\n+    {\n+        $baseCurrency = $exchangeQuery->getCurrencyPair()->getBaseCurrency();\n+\n+        $content = $this->request(self::URL);\n+        $element = StringUtil::xmlToElement($content);\n+\n+        $elements = $element->xpath('./Valute[CharCode=\"'.$baseCurrency.'\"]');\n+\n+        if (empty($elements)) {\n+            throw new UnsupportedCurrencyPairException($exchangeQuery->getCurrencyPair(), $this);\n+        }\n+\n+        $date = \\DateTime::createFromFormat('!d.m.Y', (string) $element['Date']);","path":"src/Service/RussianCentralBank.php","position":37,"original_position":37,"commit_id":"e0aa2f5a55af6eed2c76a3eb98ec6758a33ffc42","original_commit_id":"e0aa2f5a55af6eed2c76a3eb98ec6758a33ffc42","user":{"login":"florianv","id":1586668,"avatar_url":"https://avatars.githubusercontent.com/u/1586668?v=3","gravatar_id":"","url":"https://api.github.com/users/florianv","html_url":"https://github.com/florianv","followers_url":"https://api.github.com/users/florianv/followers","following_url":"https://api.github.com/users/florianv/following{/other_user}","gists_url":"https://api.github.com/users/florianv/gists{/gist_id}","starred_url":"https://api.github.com/users/florianv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florianv/subscriptions","organizations_url":"https://api.github.com/users/florianv/orgs","repos_url":"https://api.github.com/users/florianv/repos","events_url":"https://api.github.com/users/florianv/events{/privacy}","received_events_url":"https://api.github.com/users/florianv/received_events","type":"User","site_admin":false},"body":"I don't think you need the `!`","created_at":"2016-12-09T07:23:42Z","updated_at":"2016-12-09T07:27:25Z","html_url":"https://github.com/florianv/exchanger/pull/7#discussion_r91669286","pull_request_url":"https://api.github.com/repos/florianv/exchanger/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/florianv/exchanger/pulls/comments/91669286"},"html":{"href":"https://github.com/florianv/exchanger/pull/7#discussion_r91669286"},"pull_request":{"href":"https://api.github.com/repos/florianv/exchanger/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/florianv/exchanger/pulls/7","id":97136634,"html_url":"https://github.com/florianv/exchanger/pull/7","diff_url":"https://github.com/florianv/exchanger/pull/7.diff","patch_url":"https://github.com/florianv/exchanger/pull/7.patch","issue_url":"https://api.github.com/repos/florianv/exchanger/issues/7","number":7,"state":"open","locked":false,"title":"add new HistoricalService - RussianCentralBank","user":{"login":"Ellrion","id":1150861,"avatar_url":"https://avatars.githubusercontent.com/u/1150861?v=3","gravatar_id":"","url":"https://api.github.com/users/Ellrion","html_url":"https://github.com/Ellrion","followers_url":"https://api.github.com/users/Ellrion/followers","following_url":"https://api.github.com/users/Ellrion/following{/other_user}","gists_url":"https://api.github.com/users/Ellrion/gists{/gist_id}","starred_url":"https://api.github.com/users/Ellrion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ellrion/subscriptions","organizations_url":"https://api.github.com/users/Ellrion/orgs","repos_url":"https://api.github.com/users/Ellrion/repos","events_url":"https://api.github.com/users/Ellrion/events{/privacy}","received_events_url":"https://api.github.com/users/Ellrion/received_events","type":"User","site_admin":false},"body":"probably I shuld add the test and change documentation?","created_at":"2016-12-08T14:57:18Z","updated_at":"2016-12-09T07:27:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e3a0da224b923570b29a90697fa05e300e1234db","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/florianv/exchanger/pulls/7/commits","review_comments_url":"https://api.github.com/repos/florianv/exchanger/pulls/7/comments","review_comment_url":"https://api.github.com/repos/florianv/exchanger/pulls/comments{/number}","comments_url":"https://api.github.com/repos/florianv/exchanger/issues/7/comments","statuses_url":"https://api.github.com/repos/florianv/exchanger/statuses/e0aa2f5a55af6eed2c76a3eb98ec6758a33ffc42","head":{"label":"Ellrion:Ellrion-patch-2","ref":"Ellrion-patch-2","sha":"e0aa2f5a55af6eed2c76a3eb98ec6758a33ffc42","user":{"login":"Ellrion","id":1150861,"avatar_url":"https://avatars.githubusercontent.com/u/1150861?v=3","gravatar_id":"","url":"https://api.github.com/users/Ellrion","html_url":"https://github.com/Ellrion","followers_url":"https://api.github.com/users/Ellrion/followers","following_url":"https://api.github.com/users/Ellrion/following{/other_user}","gists_url":"https://api.github.com/users/Ellrion/gists{/gist_id}","starred_url":"https://api.github.com/users/Ellrion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ellrion/subscriptions","organizations_url":"https://api.github.com/users/Ellrion/orgs","repos_url":"https://api.github.com/users/Ellrion/repos","events_url":"https://api.github.com/users/Ellrion/events{/privacy}","received_events_url":"https://api.github.com/users/Ellrion/received_events","type":"User","site_admin":false},"repo":{"id":75946187,"name":"exchanger","full_name":"Ellrion/exchanger","owner":{"login":"Ellrion","id":1150861,"avatar_url":"https://avatars.githubusercontent.com/u/1150861?v=3","gravatar_id":"","url":"https://api.github.com/users/Ellrion","html_url":"https://github.com/Ellrion","followers_url":"https://api.github.com/users/Ellrion/followers","following_url":"https://api.github.com/users/Ellrion/following{/other_user}","gists_url":"https://api.github.com/users/Ellrion/gists{/gist_id}","starred_url":"https://api.github.com/users/Ellrion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ellrion/subscriptions","organizations_url":"https://api.github.com/users/Ellrion/orgs","repos_url":"https://api.github.com/users/Ellrion/repos","events_url":"https://api.github.com/users/Ellrion/events{/privacy}","received_events_url":"https://api.github.com/users/Ellrion/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ellrion/exchanger","description":"Currency exchange rates framework for PHP","fork":true,"url":"https://api.github.com/repos/Ellrion/exchanger","forks_url":"https://api.github.com/repos/Ellrion/exchanger/forks","keys_url":"https://api.github.com/repos/Ellrion/exchanger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ellrion/exchanger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ellrion/exchanger/teams","hooks_url":"https://api.github.com/repos/Ellrion/exchanger/hooks","issue_events_url":"https://api.github.com/repos/Ellrion/exchanger/issues/events{/number}","events_url":"https://api.github.com/repos/Ellrion/exchanger/events","assignees_url":"https://api.github.com/repos/Ellrion/exchanger/assignees{/user}","branches_url":"https://api.github.com/repos/Ellrion/exchanger/branches{/branch}","tags_url":"https://api.github.com/repos/Ellrion/exchanger/tags","blobs_url":"https://api.github.com/repos/Ellrion/exchanger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ellrion/exchanger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ellrion/exchanger/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ellrion/exchanger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ellrion/exchanger/statuses/{sha}","languages_url":"https://api.github.com/repos/Ellrion/exchanger/languages","stargazers_url":"https://api.github.com/repos/Ellrion/exchanger/stargazers","contributors_url":"https://api.github.com/repos/Ellrion/exchanger/contributors","subscribers_url":"https://api.github.com/repos/Ellrion/exchanger/subscribers","subscription_url":"https://api.github.com/repos/Ellrion/exchanger/subscription","commits_url":"https://api.github.com/repos/Ellrion/exchanger/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ellrion/exchanger/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ellrion/exchanger/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ellrion/exchanger/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ellrion/exchanger/contents/{+path}","compare_url":"https://api.github.com/repos/Ellrion/exchanger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ellrion/exchanger/merges","archive_url":"https://api.github.com/repos/Ellrion/exchanger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ellrion/exchanger/downloads","issues_url":"https://api.github.com/repos/Ellrion/exchanger/issues{/number}","pulls_url":"https://api.github.com/repos/Ellrion/exchanger/pulls{/number}","milestones_url":"https://api.github.com/repos/Ellrion/exchanger/milestones{/number}","notifications_url":"https://api.github.com/repos/Ellrion/exchanger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ellrion/exchanger/labels{/name}","releases_url":"https://api.github.com/repos/Ellrion/exchanger/releases{/id}","deployments_url":"https://api.github.com/repos/Ellrion/exchanger/deployments","created_at":"2016-12-08T14:44:31Z","updated_at":"2016-12-08T14:44:32Z","pushed_at":"2016-12-08T16:45:54Z","git_url":"git://github.com/Ellrion/exchanger.git","ssh_url":"git@github.com:Ellrion/exchanger.git","clone_url":"https://github.com/Ellrion/exchanger.git","svn_url":"https://github.com/Ellrion/exchanger","homepage":"http://exchanger.voutzinos.org","size":249,"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":"florianv:master","ref":"master","sha":"d9b65a22c8227cbfe24bd5b193c52abe13df5338","user":{"login":"florianv","id":1586668,"avatar_url":"https://avatars.githubusercontent.com/u/1586668?v=3","gravatar_id":"","url":"https://api.github.com/users/florianv","html_url":"https://github.com/florianv","followers_url":"https://api.github.com/users/florianv/followers","following_url":"https://api.github.com/users/florianv/following{/other_user}","gists_url":"https://api.github.com/users/florianv/gists{/gist_id}","starred_url":"https://api.github.com/users/florianv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florianv/subscriptions","organizations_url":"https://api.github.com/users/florianv/orgs","repos_url":"https://api.github.com/users/florianv/repos","events_url":"https://api.github.com/users/florianv/events{/privacy}","received_events_url":"https://api.github.com/users/florianv/received_events","type":"User","site_admin":false},"repo":{"id":67460216,"name":"exchanger","full_name":"florianv/exchanger","owner":{"login":"florianv","id":1586668,"avatar_url":"https://avatars.githubusercontent.com/u/1586668?v=3","gravatar_id":"","url":"https://api.github.com/users/florianv","html_url":"https://github.com/florianv","followers_url":"https://api.github.com/users/florianv/followers","following_url":"https://api.github.com/users/florianv/following{/other_user}","gists_url":"https://api.github.com/users/florianv/gists{/gist_id}","starred_url":"https://api.github.com/users/florianv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florianv/subscriptions","organizations_url":"https://api.github.com/users/florianv/orgs","repos_url":"https://api.github.com/users/florianv/repos","events_url":"https://api.github.com/users/florianv/events{/privacy}","received_events_url":"https://api.github.com/users/florianv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/florianv/exchanger","description":"Currency exchange rates framework for PHP","fork":false,"url":"https://api.github.com/repos/florianv/exchanger","forks_url":"https://api.github.com/repos/florianv/exchanger/forks","keys_url":"https://api.github.com/repos/florianv/exchanger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/florianv/exchanger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/florianv/exchanger/teams","hooks_url":"https://api.github.com/repos/florianv/exchanger/hooks","issue_events_url":"https://api.github.com/repos/florianv/exchanger/issues/events{/number}","events_url":"https://api.github.com/repos/florianv/exchanger/events","assignees_url":"https://api.github.com/repos/florianv/exchanger/assignees{/user}","branches_url":"https://api.github.com/repos/florianv/exchanger/branches{/branch}","tags_url":"https://api.github.com/repos/florianv/exchanger/tags","blobs_url":"https://api.github.com/repos/florianv/exchanger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/florianv/exchanger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/florianv/exchanger/git/refs{/sha}","trees_url":"https://api.github.com/repos/florianv/exchanger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/florianv/exchanger/statuses/{sha}","languages_url":"https://api.github.com/repos/florianv/exchanger/languages","stargazers_url":"https://api.github.com/repos/florianv/exchanger/stargazers","contributors_url":"https://api.github.com/repos/florianv/exchanger/contributors","subscribers_url":"https://api.github.com/repos/florianv/exchanger/subscribers","subscription_url":"https://api.github.com/repos/florianv/exchanger/subscription","commits_url":"https://api.github.com/repos/florianv/exchanger/commits{/sha}","git_commits_url":"https://api.github.com/repos/florianv/exchanger/git/commits{/sha}","comments_url":"https://api.github.com/repos/florianv/exchanger/comments{/number}","issue_comment_url":"https://api.github.com/repos/florianv/exchanger/issues/comments{/number}","contents_url":"https://api.github.com/repos/florianv/exchanger/contents/{+path}","compare_url":"https://api.github.com/repos/florianv/exchanger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/florianv/exchanger/merges","archive_url":"https://api.github.com/repos/florianv/exchanger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/florianv/exchanger/downloads","issues_url":"https://api.github.com/repos/florianv/exchanger/issues{/number}","pulls_url":"https://api.github.com/repos/florianv/exchanger/pulls{/number}","milestones_url":"https://api.github.com/repos/florianv/exchanger/milestones{/number}","notifications_url":"https://api.github.com/repos/florianv/exchanger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/florianv/exchanger/labels{/name}","releases_url":"https://api.github.com/repos/florianv/exchanger/releases{/id}","deployments_url":"https://api.github.com/repos/florianv/exchanger/deployments","created_at":"2016-09-06T00:47:59Z","updated_at":"2016-12-05T08:52:30Z","pushed_at":"2016-12-09T07:21:37Z","git_url":"git://github.com/florianv/exchanger.git","ssh_url":"git@github.com:florianv/exchanger.git","clone_url":"https://github.com/florianv/exchanger.git","svn_url":"https://github.com/florianv/exchanger","homepage":"http://exchanger.voutzinos.org","size":241,"stargazers_count":11,"watchers_count":11,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/florianv/exchanger/pulls/7"},"html":{"href":"https://github.com/florianv/exchanger/pull/7"},"issue":{"href":"https://api.github.com/repos/florianv/exchanger/issues/7"},"comments":{"href":"https://api.github.com/repos/florianv/exchanger/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/florianv/exchanger/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/florianv/exchanger/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/florianv/exchanger/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/florianv/exchanger/statuses/e0aa2f5a55af6eed2c76a3eb98ec6758a33ffc42"}}}}
{"actor":{"display_login":"florianv"}}