{"action":"created","comment":{"url":"https://api.github.com/repos/overtrue/wechat/pulls/comments/93190405","pull_request_review_id":13711645,"id":93190405,"diff_hunk":"@@ -0,0 +1,52 @@\n+<?php\n+\n+/*\n+ * This file is part of the overtrue/wechat.\n+ *\n+ * (c) overtrue <i@overtrue.me>\n+ *\n+ * This source file is subject to the MIT license that is bundled\n+ * with this source code in the file LICENSE.\n+ */\n+\n+/**\n+ * UserServiceProvider.php.\n+ *\n+ * Part of Overtrue\\WeChat.\n+ *\n+ * For the full copyright and license information, please view the LICENSE\n+ * file that was distributed with this source code.\n+ *\n+ * @author    soone <66812590@qq.com>\n+ * @copyright 2015\n+ *\n+ * @see      https://github.com/overtrue/wechat\n+ * @see      http://overtrue.me\n+ */\n+\n+namespace EasyWeChat\\Foundation\\ServiceProviders;\n+\n+use EasyWeChat\\User\\MiniAppUser;\n+use Pimple\\Container;\n+use Pimple\\ServiceProviderInterface;\n+\n+/**\n+ * Class MiniAppUserServiceProvider.\n+ */\n+class MiniAppUserServiceProvider implements ServiceProviderInterface\n+{\n+    /**\n+     * Registers services on the given container.\n+     *\n+     * This method should only be used to configure services and parameters.\n+     * It should not get services.\n+     *\n+     * @param Container $pimple A container instance\n+     */\n+    public function register(Container $pimple)\n+    {\n+        $pimple['miniappuser'] = function ($pimple) {","path":"src/Foundation/ServiceProviders/MiniAppUserServiceProvider.php","position":48,"original_position":48,"commit_id":"bb0eb0a09c615faed5ee71a09218cdf0814f5be0","original_commit_id":"bb0eb0a09c615faed5ee71a09218cdf0814f5be0","user":{"login":"soone","id":52793,"avatar_url":"https://avatars.githubusercontent.com/u/52793?v=3","gravatar_id":"","url":"https://api.github.com/users/soone","html_url":"https://github.com/soone","followers_url":"https://api.github.com/users/soone/followers","following_url":"https://api.github.com/users/soone/following{/other_user}","gists_url":"https://api.github.com/users/soone/gists{/gist_id}","starred_url":"https://api.github.com/users/soone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soone/subscriptions","organizations_url":"https://api.github.com/users/soone/orgs","repos_url":"https://api.github.com/users/soone/repos","events_url":"https://api.github.com/users/soone/events{/privacy}","received_events_url":"https://api.github.com/users/soone/received_events","type":"User","site_admin":false},"body":"ok\r\n","created_at":"2016-12-20T08:35:35Z","updated_at":"2016-12-20T08:35:35Z","html_url":"https://github.com/overtrue/wechat/pull/550#discussion_r93190405","pull_request_url":"https://api.github.com/repos/overtrue/wechat/pulls/550","_links":{"self":{"href":"https://api.github.com/repos/overtrue/wechat/pulls/comments/93190405"},"html":{"href":"https://github.com/overtrue/wechat/pull/550#discussion_r93190405"},"pull_request":{"href":"https://api.github.com/repos/overtrue/wechat/pulls/550"}}},"pull_request":{"url":"https://api.github.com/repos/overtrue/wechat/pulls/550","id":98705158,"html_url":"https://github.com/overtrue/wechat/pull/550","diff_url":"https://github.com/overtrue/wechat/pull/550.diff","patch_url":"https://github.com/overtrue/wechat/pull/550.patch","issue_url":"https://api.github.com/repos/overtrue/wechat/issues/550","number":550,"state":"open","locked":false,"title":"增加小程序用jscode获取用户信息的接口","user":{"login":"soone","id":52793,"avatar_url":"https://avatars.githubusercontent.com/u/52793?v=3","gravatar_id":"","url":"https://api.github.com/users/soone","html_url":"https://github.com/soone","followers_url":"https://api.github.com/users/soone/followers","following_url":"https://api.github.com/users/soone/following{/other_user}","gists_url":"https://api.github.com/users/soone/gists{/gist_id}","starred_url":"https://api.github.com/users/soone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soone/subscriptions","organizations_url":"https://api.github.com/users/soone/orgs","repos_url":"https://api.github.com/users/soone/repos","events_url":"https://api.github.com/users/soone/events{/privacy}","received_events_url":"https://api.github.com/users/soone/received_events","type":"User","site_admin":false},"body":"由于最近做小程序，有个通过code换取session_key的接口，详见https://mp.weixin.qq.com/debug/wxadoc/dev/api/api-login.html?t=20161122\r\n\r\n在User里面增加了MiniAppUser的类，具体使用方法为\r\n$app = new \\EasyWeChat\\Foundation\\Application($config);\r\n$app->miniappuser->get($jscode); // $jscode即为小程序获取的当前用户的code","created_at":"2016-12-20T08:28:00Z","updated_at":"2016-12-20T08:35:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94dd8cb6af4854dcc8255b8cb310e260d02b7ed0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/overtrue/wechat/pulls/550/commits","review_comments_url":"https://api.github.com/repos/overtrue/wechat/pulls/550/comments","review_comment_url":"https://api.github.com/repos/overtrue/wechat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/overtrue/wechat/issues/550/comments","statuses_url":"https://api.github.com/repos/overtrue/wechat/statuses/bb0eb0a09c615faed5ee71a09218cdf0814f5be0","head":{"label":"soone:master","ref":"master","sha":"bb0eb0a09c615faed5ee71a09218cdf0814f5be0","user":{"login":"soone","id":52793,"avatar_url":"https://avatars.githubusercontent.com/u/52793?v=3","gravatar_id":"","url":"https://api.github.com/users/soone","html_url":"https://github.com/soone","followers_url":"https://api.github.com/users/soone/followers","following_url":"https://api.github.com/users/soone/following{/other_user}","gists_url":"https://api.github.com/users/soone/gists{/gist_id}","starred_url":"https://api.github.com/users/soone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soone/subscriptions","organizations_url":"https://api.github.com/users/soone/orgs","repos_url":"https://api.github.com/users/soone/repos","events_url":"https://api.github.com/users/soone/events{/privacy}","received_events_url":"https://api.github.com/users/soone/received_events","type":"User","site_admin":false},"repo":{"id":73156796,"name":"wechat","full_name":"soone/wechat","owner":{"login":"soone","id":52793,"avatar_url":"https://avatars.githubusercontent.com/u/52793?v=3","gravatar_id":"","url":"https://api.github.com/users/soone","html_url":"https://github.com/soone","followers_url":"https://api.github.com/users/soone/followers","following_url":"https://api.github.com/users/soone/following{/other_user}","gists_url":"https://api.github.com/users/soone/gists{/gist_id}","starred_url":"https://api.github.com/users/soone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soone/subscriptions","organizations_url":"https://api.github.com/users/soone/orgs","repos_url":"https://api.github.com/users/soone/repos","events_url":"https://api.github.com/users/soone/events{/privacy}","received_events_url":"https://api.github.com/users/soone/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/soone/wechat","description":":package: Maybe it is the best SDK for develop WeChat App.","fork":true,"url":"https://api.github.com/repos/soone/wechat","forks_url":"https://api.github.com/repos/soone/wechat/forks","keys_url":"https://api.github.com/repos/soone/wechat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/soone/wechat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/soone/wechat/teams","hooks_url":"https://api.github.com/repos/soone/wechat/hooks","issue_events_url":"https://api.github.com/repos/soone/wechat/issues/events{/number}","events_url":"https://api.github.com/repos/soone/wechat/events","assignees_url":"https://api.github.com/repos/soone/wechat/assignees{/user}","branches_url":"https://api.github.com/repos/soone/wechat/branches{/branch}","tags_url":"https://api.github.com/repos/soone/wechat/tags","blobs_url":"https://api.github.com/repos/soone/wechat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/soone/wechat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/soone/wechat/git/refs{/sha}","trees_url":"https://api.github.com/repos/soone/wechat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/soone/wechat/statuses/{sha}","languages_url":"https://api.github.com/repos/soone/wechat/languages","stargazers_url":"https://api.github.com/repos/soone/wechat/stargazers","contributors_url":"https://api.github.com/repos/soone/wechat/contributors","subscribers_url":"https://api.github.com/repos/soone/wechat/subscribers","subscription_url":"https://api.github.com/repos/soone/wechat/subscription","commits_url":"https://api.github.com/repos/soone/wechat/commits{/sha}","git_commits_url":"https://api.github.com/repos/soone/wechat/git/commits{/sha}","comments_url":"https://api.github.com/repos/soone/wechat/comments{/number}","issue_comment_url":"https://api.github.com/repos/soone/wechat/issues/comments{/number}","contents_url":"https://api.github.com/repos/soone/wechat/contents/{+path}","compare_url":"https://api.github.com/repos/soone/wechat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/soone/wechat/merges","archive_url":"https://api.github.com/repos/soone/wechat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/soone/wechat/downloads","issues_url":"https://api.github.com/repos/soone/wechat/issues{/number}","pulls_url":"https://api.github.com/repos/soone/wechat/pulls{/number}","milestones_url":"https://api.github.com/repos/soone/wechat/milestones{/number}","notifications_url":"https://api.github.com/repos/soone/wechat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/soone/wechat/labels{/name}","releases_url":"https://api.github.com/repos/soone/wechat/releases{/id}","deployments_url":"https://api.github.com/repos/soone/wechat/deployments","created_at":"2016-11-08T06:37:41Z","updated_at":"2016-11-08T06:37:42Z","pushed_at":"2016-12-20T08:22:53Z","git_url":"git://github.com/soone/wechat.git","ssh_url":"git@github.com:soone/wechat.git","clone_url":"https://github.com/soone/wechat.git","svn_url":"https://github.com/soone/wechat","homepage":"http://easywechat.org","size":1337,"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":"overtrue:master","ref":"master","sha":"35062f10cb8d3a6a94e06e14d0d81f7af335a56a","user":{"login":"overtrue","id":1472352,"avatar_url":"https://avatars.githubusercontent.com/u/1472352?v=3","gravatar_id":"","url":"https://api.github.com/users/overtrue","html_url":"https://github.com/overtrue","followers_url":"https://api.github.com/users/overtrue/followers","following_url":"https://api.github.com/users/overtrue/following{/other_user}","gists_url":"https://api.github.com/users/overtrue/gists{/gist_id}","starred_url":"https://api.github.com/users/overtrue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/overtrue/subscriptions","organizations_url":"https://api.github.com/users/overtrue/orgs","repos_url":"https://api.github.com/users/overtrue/repos","events_url":"https://api.github.com/users/overtrue/events{/privacy}","received_events_url":"https://api.github.com/users/overtrue/received_events","type":"User","site_admin":false},"repo":{"id":29843361,"name":"wechat","full_name":"overtrue/wechat","owner":{"login":"overtrue","id":1472352,"avatar_url":"https://avatars.githubusercontent.com/u/1472352?v=3","gravatar_id":"","url":"https://api.github.com/users/overtrue","html_url":"https://github.com/overtrue","followers_url":"https://api.github.com/users/overtrue/followers","following_url":"https://api.github.com/users/overtrue/following{/other_user}","gists_url":"https://api.github.com/users/overtrue/gists{/gist_id}","starred_url":"https://api.github.com/users/overtrue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/overtrue/subscriptions","organizations_url":"https://api.github.com/users/overtrue/orgs","repos_url":"https://api.github.com/users/overtrue/repos","events_url":"https://api.github.com/users/overtrue/events{/privacy}","received_events_url":"https://api.github.com/users/overtrue/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/overtrue/wechat","description":":package: Maybe it is the best SDK for develop WeChat App.","fork":false,"url":"https://api.github.com/repos/overtrue/wechat","forks_url":"https://api.github.com/repos/overtrue/wechat/forks","keys_url":"https://api.github.com/repos/overtrue/wechat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/overtrue/wechat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/overtrue/wechat/teams","hooks_url":"https://api.github.com/repos/overtrue/wechat/hooks","issue_events_url":"https://api.github.com/repos/overtrue/wechat/issues/events{/number}","events_url":"https://api.github.com/repos/overtrue/wechat/events","assignees_url":"https://api.github.com/repos/overtrue/wechat/assignees{/user}","branches_url":"https://api.github.com/repos/overtrue/wechat/branches{/branch}","tags_url":"https://api.github.com/repos/overtrue/wechat/tags","blobs_url":"https://api.github.com/repos/overtrue/wechat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/overtrue/wechat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/overtrue/wechat/git/refs{/sha}","trees_url":"https://api.github.com/repos/overtrue/wechat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/overtrue/wechat/statuses/{sha}","languages_url":"https://api.github.com/repos/overtrue/wechat/languages","stargazers_url":"https://api.github.com/repos/overtrue/wechat/stargazers","contributors_url":"https://api.github.com/repos/overtrue/wechat/contributors","subscribers_url":"https://api.github.com/repos/overtrue/wechat/subscribers","subscription_url":"https://api.github.com/repos/overtrue/wechat/subscription","commits_url":"https://api.github.com/repos/overtrue/wechat/commits{/sha}","git_commits_url":"https://api.github.com/repos/overtrue/wechat/git/commits{/sha}","comments_url":"https://api.github.com/repos/overtrue/wechat/comments{/number}","issue_comment_url":"https://api.github.com/repos/overtrue/wechat/issues/comments{/number}","contents_url":"https://api.github.com/repos/overtrue/wechat/contents/{+path}","compare_url":"https://api.github.com/repos/overtrue/wechat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/overtrue/wechat/merges","archive_url":"https://api.github.com/repos/overtrue/wechat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/overtrue/wechat/downloads","issues_url":"https://api.github.com/repos/overtrue/wechat/issues{/number}","pulls_url":"https://api.github.com/repos/overtrue/wechat/pulls{/number}","milestones_url":"https://api.github.com/repos/overtrue/wechat/milestones{/number}","notifications_url":"https://api.github.com/repos/overtrue/wechat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/overtrue/wechat/labels{/name}","releases_url":"https://api.github.com/repos/overtrue/wechat/releases{/id}","deployments_url":"https://api.github.com/repos/overtrue/wechat/deployments","created_at":"2015-01-26T03:30:40Z","updated_at":"2016-12-20T08:30:58Z","pushed_at":"2016-12-20T08:28:01Z","git_url":"git://github.com/overtrue/wechat.git","ssh_url":"git@github.com:overtrue/wechat.git","clone_url":"https://github.com/overtrue/wechat.git","svn_url":"https://github.com/overtrue/wechat","homepage":"http://easywechat.org","size":1370,"stargazers_count":3788,"watchers_count":3788,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1099,"mirror_url":null,"open_issues_count":5,"forks":1099,"open_issues":5,"watchers":3788,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/overtrue/wechat/pulls/550"},"html":{"href":"https://github.com/overtrue/wechat/pull/550"},"issue":{"href":"https://api.github.com/repos/overtrue/wechat/issues/550"},"comments":{"href":"https://api.github.com/repos/overtrue/wechat/issues/550/comments"},"review_comments":{"href":"https://api.github.com/repos/overtrue/wechat/pulls/550/comments"},"review_comment":{"href":"https://api.github.com/repos/overtrue/wechat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/overtrue/wechat/pulls/550/commits"},"statuses":{"href":"https://api.github.com/repos/overtrue/wechat/statuses/bb0eb0a09c615faed5ee71a09218cdf0814f5be0"}}}}
{"actor":{"display_login":"soone"}}