{"action":"closed","number":325,"pull_request":{"url":"https://api.github.com/repos/top-think/framework/pulls/325","id":90318489,"html_url":"https://github.com/top-think/framework/pull/325","diff_url":"https://github.com/top-think/framework/pull/325.diff","patch_url":"https://github.com/top-think/framework/pull/325.patch","issue_url":"https://api.github.com/repos/top-think/framework/issues/325","number":325,"state":"closed","locked":false,"title":"为Request类的几个方法完善注释","user":{"login":"clyoko","id":8706905,"avatar_url":"https://avatars.githubusercontent.com/u/8706905?v=3","gravatar_id":"","url":"https://api.github.com/users/clyoko","html_url":"https://github.com/clyoko","followers_url":"https://api.github.com/users/clyoko/followers","following_url":"https://api.github.com/users/clyoko/following{/other_user}","gists_url":"https://api.github.com/users/clyoko/gists{/gist_id}","starred_url":"https://api.github.com/users/clyoko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clyoko/subscriptions","organizations_url":"https://api.github.com/users/clyoko/orgs","repos_url":"https://api.github.com/users/clyoko/repos","events_url":"https://api.github.com/users/clyoko/events{/privacy}","received_events_url":"https://api.github.com/users/clyoko/received_events","type":"User","site_admin":false},"body":"在phpstorm2016.2.1中，使用下列语句会提示警告： \r\n\r\n>Method __toString is not implemented for '\\think\\Request' less... (Ctrl+F1) \r\n\r\n>This inspection detects attempts to convert objects without __toString() method implementation to string, since PHP 5.2.0, it would cause E_RECOVERABLE_ERROR. \"Check __toString exists for each expression type\": if the option is on, the inspection will check all possible types of the expression and report if at least one ot them doesn't contain __toString() method implementation. \r\n\r\n```\r\n$request = Request::instance();\r\necho \"当前模块名称是\" . $request->module();// 这句会被IDE提示警告\r\necho \"当前控制器名称是\" . $request->controller();// 这句会被IDE提示警告\r\necho \"当前操作名称是\" . $request->action();// 这句就不会\r\n```\r\n\r\n后来发现是注释引起的问题，注释中有`@return string|$this`。而action()方法却写成`@return string`。个人认为应该统一写成`@return string|Request` 比较合适。使用`$this`可能是想表示返回这个对象自身，但造成了一些麻烦。\r\n\r\n而且，`langset()`和`action()`方法写法和另外两个一样有可能返回`$this`，却没有在注释中体现。\r\n\r\n```\r\n/**\r\n     * 设置或者获取当前的模块名\r\n     * @access public\r\n     * @param string $module 模块名\r\n     * @return string|$this\r\n     */\r\n    public function module($module = null)\r\n```\r\n学识短浅，仅供参考 。","created_at":"2016-10-21T03:41:34Z","updated_at":"2016-10-21T09:25:16Z","closed_at":"2016-10-21T09:25:16Z","merged_at":"2016-10-21T09:25:16Z","merge_commit_sha":"d0fd890ce9aadf51413f62d48c82b49933645261","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/top-think/framework/pulls/325/commits","review_comments_url":"https://api.github.com/repos/top-think/framework/pulls/325/comments","review_comment_url":"https://api.github.com/repos/top-think/framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/top-think/framework/issues/325/comments","statuses_url":"https://api.github.com/repos/top-think/framework/statuses/c64a33588429553da4ceb0a645bfccaec8a826ed","head":{"label":"clyoko:master","ref":"master","sha":"c64a33588429553da4ceb0a645bfccaec8a826ed","user":{"login":"clyoko","id":8706905,"avatar_url":"https://avatars.githubusercontent.com/u/8706905?v=3","gravatar_id":"","url":"https://api.github.com/users/clyoko","html_url":"https://github.com/clyoko","followers_url":"https://api.github.com/users/clyoko/followers","following_url":"https://api.github.com/users/clyoko/following{/other_user}","gists_url":"https://api.github.com/users/clyoko/gists{/gist_id}","starred_url":"https://api.github.com/users/clyoko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clyoko/subscriptions","organizations_url":"https://api.github.com/users/clyoko/orgs","repos_url":"https://api.github.com/users/clyoko/repos","events_url":"https://api.github.com/users/clyoko/events{/privacy}","received_events_url":"https://api.github.com/users/clyoko/received_events","type":"User","site_admin":false},"repo":{"id":71526725,"name":"framework","full_name":"clyoko/framework","owner":{"login":"clyoko","id":8706905,"avatar_url":"https://avatars.githubusercontent.com/u/8706905?v=3","gravatar_id":"","url":"https://api.github.com/users/clyoko","html_url":"https://github.com/clyoko","followers_url":"https://api.github.com/users/clyoko/followers","following_url":"https://api.github.com/users/clyoko/following{/other_user}","gists_url":"https://api.github.com/users/clyoko/gists{/gist_id}","starred_url":"https://api.github.com/users/clyoko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clyoko/subscriptions","organizations_url":"https://api.github.com/users/clyoko/orgs","repos_url":"https://api.github.com/users/clyoko/repos","events_url":"https://api.github.com/users/clyoko/events{/privacy}","received_events_url":"https://api.github.com/users/clyoko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/clyoko/framework","description":"ThinkPHP5 核心框架包","fork":true,"url":"https://api.github.com/repos/clyoko/framework","forks_url":"https://api.github.com/repos/clyoko/framework/forks","keys_url":"https://api.github.com/repos/clyoko/framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clyoko/framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clyoko/framework/teams","hooks_url":"https://api.github.com/repos/clyoko/framework/hooks","issue_events_url":"https://api.github.com/repos/clyoko/framework/issues/events{/number}","events_url":"https://api.github.com/repos/clyoko/framework/events","assignees_url":"https://api.github.com/repos/clyoko/framework/assignees{/user}","branches_url":"https://api.github.com/repos/clyoko/framework/branches{/branch}","tags_url":"https://api.github.com/repos/clyoko/framework/tags","blobs_url":"https://api.github.com/repos/clyoko/framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clyoko/framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clyoko/framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/clyoko/framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clyoko/framework/statuses/{sha}","languages_url":"https://api.github.com/repos/clyoko/framework/languages","stargazers_url":"https://api.github.com/repos/clyoko/framework/stargazers","contributors_url":"https://api.github.com/repos/clyoko/framework/contributors","subscribers_url":"https://api.github.com/repos/clyoko/framework/subscribers","subscription_url":"https://api.github.com/repos/clyoko/framework/subscription","commits_url":"https://api.github.com/repos/clyoko/framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/clyoko/framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/clyoko/framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/clyoko/framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/clyoko/framework/contents/{+path}","compare_url":"https://api.github.com/repos/clyoko/framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clyoko/framework/merges","archive_url":"https://api.github.com/repos/clyoko/framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clyoko/framework/downloads","issues_url":"https://api.github.com/repos/clyoko/framework/issues{/number}","pulls_url":"https://api.github.com/repos/clyoko/framework/pulls{/number}","milestones_url":"https://api.github.com/repos/clyoko/framework/milestones{/number}","notifications_url":"https://api.github.com/repos/clyoko/framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clyoko/framework/labels{/name}","releases_url":"https://api.github.com/repos/clyoko/framework/releases{/id}","deployments_url":"https://api.github.com/repos/clyoko/framework/deployments","created_at":"2016-10-21T03:34:20Z","updated_at":"2016-10-21T03:34:21Z","pushed_at":"2016-10-21T03:36:56Z","git_url":"git://github.com/clyoko/framework.git","ssh_url":"git@github.com:clyoko/framework.git","clone_url":"https://github.com/clyoko/framework.git","svn_url":"https://github.com/clyoko/framework","homepage":"","size":7976,"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":"top-think:master","ref":"master","sha":"3be17ea06b23aab8d5436f026b4a9d5769444da3","user":{"login":"top-think","id":16305258,"avatar_url":"https://avatars.githubusercontent.com/u/16305258?v=3","gravatar_id":"","url":"https://api.github.com/users/top-think","html_url":"https://github.com/top-think","followers_url":"https://api.github.com/users/top-think/followers","following_url":"https://api.github.com/users/top-think/following{/other_user}","gists_url":"https://api.github.com/users/top-think/gists{/gist_id}","starred_url":"https://api.github.com/users/top-think/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/top-think/subscriptions","organizations_url":"https://api.github.com/users/top-think/orgs","repos_url":"https://api.github.com/users/top-think/repos","events_url":"https://api.github.com/users/top-think/events{/privacy}","received_events_url":"https://api.github.com/users/top-think/received_events","type":"Organization","site_admin":false},"repo":{"id":48530411,"name":"framework","full_name":"top-think/framework","owner":{"login":"top-think","id":16305258,"avatar_url":"https://avatars.githubusercontent.com/u/16305258?v=3","gravatar_id":"","url":"https://api.github.com/users/top-think","html_url":"https://github.com/top-think","followers_url":"https://api.github.com/users/top-think/followers","following_url":"https://api.github.com/users/top-think/following{/other_user}","gists_url":"https://api.github.com/users/top-think/gists{/gist_id}","starred_url":"https://api.github.com/users/top-think/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/top-think/subscriptions","organizations_url":"https://api.github.com/users/top-think/orgs","repos_url":"https://api.github.com/users/top-think/repos","events_url":"https://api.github.com/users/top-think/events{/privacy}","received_events_url":"https://api.github.com/users/top-think/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/top-think/framework","description":"ThinkPHP5 核心框架包","fork":false,"url":"https://api.github.com/repos/top-think/framework","forks_url":"https://api.github.com/repos/top-think/framework/forks","keys_url":"https://api.github.com/repos/top-think/framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/top-think/framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/top-think/framework/teams","hooks_url":"https://api.github.com/repos/top-think/framework/hooks","issue_events_url":"https://api.github.com/repos/top-think/framework/issues/events{/number}","events_url":"https://api.github.com/repos/top-think/framework/events","assignees_url":"https://api.github.com/repos/top-think/framework/assignees{/user}","branches_url":"https://api.github.com/repos/top-think/framework/branches{/branch}","tags_url":"https://api.github.com/repos/top-think/framework/tags","blobs_url":"https://api.github.com/repos/top-think/framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/top-think/framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/top-think/framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/top-think/framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/top-think/framework/statuses/{sha}","languages_url":"https://api.github.com/repos/top-think/framework/languages","stargazers_url":"https://api.github.com/repos/top-think/framework/stargazers","contributors_url":"https://api.github.com/repos/top-think/framework/contributors","subscribers_url":"https://api.github.com/repos/top-think/framework/subscribers","subscription_url":"https://api.github.com/repos/top-think/framework/subscription","commits_url":"https://api.github.com/repos/top-think/framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/top-think/framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/top-think/framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/top-think/framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/top-think/framework/contents/{+path}","compare_url":"https://api.github.com/repos/top-think/framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/top-think/framework/merges","archive_url":"https://api.github.com/repos/top-think/framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/top-think/framework/downloads","issues_url":"https://api.github.com/repos/top-think/framework/issues{/number}","pulls_url":"https://api.github.com/repos/top-think/framework/pulls{/number}","milestones_url":"https://api.github.com/repos/top-think/framework/milestones{/number}","notifications_url":"https://api.github.com/repos/top-think/framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/top-think/framework/labels{/name}","releases_url":"https://api.github.com/repos/top-think/framework/releases{/id}","deployments_url":"https://api.github.com/repos/top-think/framework/deployments","created_at":"2015-12-24T07:12:35Z","updated_at":"2016-10-21T06:30:04Z","pushed_at":"2016-10-21T09:25:17Z","git_url":"git://github.com/top-think/framework.git","ssh_url":"git@github.com:top-think/framework.git","clone_url":"https://github.com/top-think/framework.git","svn_url":"https://github.com/top-think/framework","homepage":"","size":9426,"stargazers_count":281,"watchers_count":281,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":188,"mirror_url":null,"open_issues_count":70,"forks":188,"open_issues":70,"watchers":281,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/top-think/framework/pulls/325"},"html":{"href":"https://github.com/top-think/framework/pull/325"},"issue":{"href":"https://api.github.com/repos/top-think/framework/issues/325"},"comments":{"href":"https://api.github.com/repos/top-think/framework/issues/325/comments"},"review_comments":{"href":"https://api.github.com/repos/top-think/framework/pulls/325/comments"},"review_comment":{"href":"https://api.github.com/repos/top-think/framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/top-think/framework/pulls/325/commits"},"statuses":{"href":"https://api.github.com/repos/top-think/framework/statuses/c64a33588429553da4ceb0a645bfccaec8a826ed"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"liu21st","id":1111670,"avatar_url":"https://avatars.githubusercontent.com/u/1111670?v=3","gravatar_id":"","url":"https://api.github.com/users/liu21st","html_url":"https://github.com/liu21st","followers_url":"https://api.github.com/users/liu21st/followers","following_url":"https://api.github.com/users/liu21st/following{/other_user}","gists_url":"https://api.github.com/users/liu21st/gists{/gist_id}","starred_url":"https://api.github.com/users/liu21st/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liu21st/subscriptions","organizations_url":"https://api.github.com/users/liu21st/orgs","repos_url":"https://api.github.com/users/liu21st/repos","events_url":"https://api.github.com/users/liu21st/events{/privacy}","received_events_url":"https://api.github.com/users/liu21st/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":4,"deletions":4,"changed_files":1}}
{"actor":{"display_login":"liu21st"}}