{"action":"closed","number":8,"pull_request":{"url":"https://api.github.com/repos/WP-API/OAuth2/pulls/8","id":127985822,"html_url":"https://github.com/WP-API/OAuth2/pull/8","diff_url":"https://github.com/WP-API/OAuth2/pull/8.diff","patch_url":"https://github.com/WP-API/OAuth2/pull/8.patch","issue_url":"https://api.github.com/repos/WP-API/OAuth2/issues/8","number":8,"state":"closed","locked":false,"title":"House cleaning.","user":{"login":"tfrommen","id":6049306,"avatar_url":"https://avatars1.githubusercontent.com/u/6049306?v=3","gravatar_id":"","url":"https://api.github.com/users/tfrommen","html_url":"https://github.com/tfrommen","followers_url":"https://api.github.com/users/tfrommen/followers","following_url":"https://api.github.com/users/tfrommen/following{/other_user}","gists_url":"https://api.github.com/users/tfrommen/gists{/gist_id}","starred_url":"https://api.github.com/users/tfrommen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfrommen/subscriptions","organizations_url":"https://api.github.com/users/tfrommen/orgs","repos_url":"https://api.github.com/users/tfrommen/repos","events_url":"https://api.github.com/users/tfrommen/events{/privacy}","received_events_url":"https://api.github.com/users/tfrommen/received_events","type":"User","site_admin":false},"body":"Hi there! 👋\r\n\r\nI had some time, so I went through the current code base (i.e., the `auth-code-flow` branch, which this PR thus targets), with an army of house elves, and fixed, updated and improved a few things here and there.\r\n\r\nSorry for not splitting up commits. I did this on purpose, though, because otherwise we would've ended up with 42 (!) commits, ... or so.\r\nI did **not** do any real changes to functionality, though, but see for yourself...\r\n\r\n### What Does This Pull Request Include?\r\n\r\n* General: \r\n    * Replace almost all mentions of OAuth1 with OAuth2.\r\n    * Require WordPress version 4.8 or higher.\r\n    * Bump tested WordPress version to 4.8.\r\n* Code:\r\n    * Remove unused stuff (e.g., variables, namespace imports).\r\n    * Add/Adapt phpDoc blocks for methods with either parameters or return values, or both.\r\n    * Add missing namespace imports.\r\n    * Add a few type hints.\r\n    * Make `WP\\OAuth2\\Client::check_redirect_uri()` return `true` or `false`.\r\n    * Improve and streamline `WP\\OAuth2\\Endpoints\\Authorization::handle_request()`.\r\n    * Ensure authorization code expiration is numeric, and return an `int`.\r\n    * Make `WP\\OAuth2\\Tokens\\Token::is_valid()` abstract, and **not** static anymore.\r\n    * Introduce **abstract** `WP\\OAuth2\\Tokens\\Token::get_meta_prefix()` method.\r\n    * Make PhpStorm (or any other decent IDE) aware of `$client` in the login template.\r\n\r\n### What's Left?\r\n\r\n* Coding Standards:\r\n    * Every third file looks different than the others.\r\n    * Where to put blank lines (both in code and comments)?\r\n    * Import classes in the global namespace, yes or no?\r\n* `admin.php`:\r\n    * I did not touch this file at all.\r\n    * It is broken, though.\r\n    * The referenced file `lib/class-wp-rest-oauth1-admin.php` does not exist in this plugin.\r\n    * `oauth1` all over.\r\n* `inc/class-scopes.php`:\r\n    * I did not touch this file at all.\r\n    * I don't get it. 😅\r\n    * It's not referenced/used at all.\r\n    * Properties are either defined and not used, or not defined, but set. 🤔\r\n* `inc/endpoints/class-authorization.php`:\r\n    * The `handle_request()` method uses `OAuth2\\get_grant_types()`, which returns the **unvalidated** result of a filter, `oauth2.grant_types`.\r\n    * There is direct, but unchecked access to assumed methods.\r\n    * In my opinion, the `OAuth2\\get_grant_types()` function should both validate the data (and remove invalid handlers) and state `WP\\OAuth2\\Types\\Type[]` instead of `array` as return type.\r\n* `inc/tokens/class-authorization-code.php`:\r\n    * I assume the `$args` parameter in `WP\\OAuth2\\Tokens\\Authorization_Code::validate()` is for inheritance...?\r\n* Possibly other stuff...\r\n\r\nAgain, this PR targets the `auth-code-flow` branch. If you want me to make it target `master` instead, just tell me.\r\n\r\nCheers,\r\nThorsten","created_at":"2017-06-28T18:12:13Z","updated_at":"2017-07-01T06:05:24Z","closed_at":"2017-07-01T06:05:24Z","merged_at":"2017-07-01T06:05:24Z","merge_commit_sha":"3a95f1fc4ccc150de7402c26a82f5e55e230a769","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/WP-API/OAuth2/pulls/8/commits","review_comments_url":"https://api.github.com/repos/WP-API/OAuth2/pulls/8/comments","review_comment_url":"https://api.github.com/repos/WP-API/OAuth2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WP-API/OAuth2/issues/8/comments","statuses_url":"https://api.github.com/repos/WP-API/OAuth2/statuses/9d274c01d11f1fa9556e9afad7eddc54569e2a46","head":{"label":"tfrommen:house-cleaning","ref":"house-cleaning","sha":"9d274c01d11f1fa9556e9afad7eddc54569e2a46","user":{"login":"tfrommen","id":6049306,"avatar_url":"https://avatars1.githubusercontent.com/u/6049306?v=3","gravatar_id":"","url":"https://api.github.com/users/tfrommen","html_url":"https://github.com/tfrommen","followers_url":"https://api.github.com/users/tfrommen/followers","following_url":"https://api.github.com/users/tfrommen/following{/other_user}","gists_url":"https://api.github.com/users/tfrommen/gists{/gist_id}","starred_url":"https://api.github.com/users/tfrommen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfrommen/subscriptions","organizations_url":"https://api.github.com/users/tfrommen/orgs","repos_url":"https://api.github.com/users/tfrommen/repos","events_url":"https://api.github.com/users/tfrommen/events{/privacy}","received_events_url":"https://api.github.com/users/tfrommen/received_events","type":"User","site_admin":false},"repo":{"id":94448482,"name":"OAuth2","full_name":"tfrommen/OAuth2","owner":{"login":"tfrommen","id":6049306,"avatar_url":"https://avatars1.githubusercontent.com/u/6049306?v=3","gravatar_id":"","url":"https://api.github.com/users/tfrommen","html_url":"https://github.com/tfrommen","followers_url":"https://api.github.com/users/tfrommen/followers","following_url":"https://api.github.com/users/tfrommen/following{/other_user}","gists_url":"https://api.github.com/users/tfrommen/gists{/gist_id}","starred_url":"https://api.github.com/users/tfrommen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfrommen/subscriptions","organizations_url":"https://api.github.com/users/tfrommen/orgs","repos_url":"https://api.github.com/users/tfrommen/repos","events_url":"https://api.github.com/users/tfrommen/events{/privacy}","received_events_url":"https://api.github.com/users/tfrommen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tfrommen/OAuth2","description":null,"fork":true,"url":"https://api.github.com/repos/tfrommen/OAuth2","forks_url":"https://api.github.com/repos/tfrommen/OAuth2/forks","keys_url":"https://api.github.com/repos/tfrommen/OAuth2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tfrommen/OAuth2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tfrommen/OAuth2/teams","hooks_url":"https://api.github.com/repos/tfrommen/OAuth2/hooks","issue_events_url":"https://api.github.com/repos/tfrommen/OAuth2/issues/events{/number}","events_url":"https://api.github.com/repos/tfrommen/OAuth2/events","assignees_url":"https://api.github.com/repos/tfrommen/OAuth2/assignees{/user}","branches_url":"https://api.github.com/repos/tfrommen/OAuth2/branches{/branch}","tags_url":"https://api.github.com/repos/tfrommen/OAuth2/tags","blobs_url":"https://api.github.com/repos/tfrommen/OAuth2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tfrommen/OAuth2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tfrommen/OAuth2/git/refs{/sha}","trees_url":"https://api.github.com/repos/tfrommen/OAuth2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tfrommen/OAuth2/statuses/{sha}","languages_url":"https://api.github.com/repos/tfrommen/OAuth2/languages","stargazers_url":"https://api.github.com/repos/tfrommen/OAuth2/stargazers","contributors_url":"https://api.github.com/repos/tfrommen/OAuth2/contributors","subscribers_url":"https://api.github.com/repos/tfrommen/OAuth2/subscribers","subscription_url":"https://api.github.com/repos/tfrommen/OAuth2/subscription","commits_url":"https://api.github.com/repos/tfrommen/OAuth2/commits{/sha}","git_commits_url":"https://api.github.com/repos/tfrommen/OAuth2/git/commits{/sha}","comments_url":"https://api.github.com/repos/tfrommen/OAuth2/comments{/number}","issue_comment_url":"https://api.github.com/repos/tfrommen/OAuth2/issues/comments{/number}","contents_url":"https://api.github.com/repos/tfrommen/OAuth2/contents/{+path}","compare_url":"https://api.github.com/repos/tfrommen/OAuth2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tfrommen/OAuth2/merges","archive_url":"https://api.github.com/repos/tfrommen/OAuth2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tfrommen/OAuth2/downloads","issues_url":"https://api.github.com/repos/tfrommen/OAuth2/issues{/number}","pulls_url":"https://api.github.com/repos/tfrommen/OAuth2/pulls{/number}","milestones_url":"https://api.github.com/repos/tfrommen/OAuth2/milestones{/number}","notifications_url":"https://api.github.com/repos/tfrommen/OAuth2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tfrommen/OAuth2/labels{/name}","releases_url":"https://api.github.com/repos/tfrommen/OAuth2/releases{/id}","deployments_url":"https://api.github.com/repos/tfrommen/OAuth2/deployments","created_at":"2017-06-15T14:38:34Z","updated_at":"2017-06-15T14:38:35Z","pushed_at":"2017-06-28T17:45:17Z","git_url":"git://github.com/tfrommen/OAuth2.git","ssh_url":"git@github.com:tfrommen/OAuth2.git","clone_url":"https://github.com/tfrommen/OAuth2.git","svn_url":"https://github.com/tfrommen/OAuth2","homepage":null,"size":325,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"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":"WP-API:auth-code-flow","ref":"auth-code-flow","sha":"3ca28b9a09a4774da2dbb71d988aaf73ad0caf8a","user":{"login":"WP-API","id":5706008,"avatar_url":"https://avatars1.githubusercontent.com/u/5706008?v=3","gravatar_id":"","url":"https://api.github.com/users/WP-API","html_url":"https://github.com/WP-API","followers_url":"https://api.github.com/users/WP-API/followers","following_url":"https://api.github.com/users/WP-API/following{/other_user}","gists_url":"https://api.github.com/users/WP-API/gists{/gist_id}","starred_url":"https://api.github.com/users/WP-API/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WP-API/subscriptions","organizations_url":"https://api.github.com/users/WP-API/orgs","repos_url":"https://api.github.com/users/WP-API/repos","events_url":"https://api.github.com/users/WP-API/events{/privacy}","received_events_url":"https://api.github.com/users/WP-API/received_events","type":"Organization","site_admin":false},"repo":{"id":94413767,"name":"OAuth2","full_name":"WP-API/OAuth2","owner":{"login":"WP-API","id":5706008,"avatar_url":"https://avatars1.githubusercontent.com/u/5706008?v=3","gravatar_id":"","url":"https://api.github.com/users/WP-API","html_url":"https://github.com/WP-API","followers_url":"https://api.github.com/users/WP-API/followers","following_url":"https://api.github.com/users/WP-API/following{/other_user}","gists_url":"https://api.github.com/users/WP-API/gists{/gist_id}","starred_url":"https://api.github.com/users/WP-API/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WP-API/subscriptions","organizations_url":"https://api.github.com/users/WP-API/orgs","repos_url":"https://api.github.com/users/WP-API/repos","events_url":"https://api.github.com/users/WP-API/events{/privacy}","received_events_url":"https://api.github.com/users/WP-API/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WP-API/OAuth2","description":null,"fork":false,"url":"https://api.github.com/repos/WP-API/OAuth2","forks_url":"https://api.github.com/repos/WP-API/OAuth2/forks","keys_url":"https://api.github.com/repos/WP-API/OAuth2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WP-API/OAuth2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WP-API/OAuth2/teams","hooks_url":"https://api.github.com/repos/WP-API/OAuth2/hooks","issue_events_url":"https://api.github.com/repos/WP-API/OAuth2/issues/events{/number}","events_url":"https://api.github.com/repos/WP-API/OAuth2/events","assignees_url":"https://api.github.com/repos/WP-API/OAuth2/assignees{/user}","branches_url":"https://api.github.com/repos/WP-API/OAuth2/branches{/branch}","tags_url":"https://api.github.com/repos/WP-API/OAuth2/tags","blobs_url":"https://api.github.com/repos/WP-API/OAuth2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WP-API/OAuth2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WP-API/OAuth2/git/refs{/sha}","trees_url":"https://api.github.com/repos/WP-API/OAuth2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WP-API/OAuth2/statuses/{sha}","languages_url":"https://api.github.com/repos/WP-API/OAuth2/languages","stargazers_url":"https://api.github.com/repos/WP-API/OAuth2/stargazers","contributors_url":"https://api.github.com/repos/WP-API/OAuth2/contributors","subscribers_url":"https://api.github.com/repos/WP-API/OAuth2/subscribers","subscription_url":"https://api.github.com/repos/WP-API/OAuth2/subscription","commits_url":"https://api.github.com/repos/WP-API/OAuth2/commits{/sha}","git_commits_url":"https://api.github.com/repos/WP-API/OAuth2/git/commits{/sha}","comments_url":"https://api.github.com/repos/WP-API/OAuth2/comments{/number}","issue_comment_url":"https://api.github.com/repos/WP-API/OAuth2/issues/comments{/number}","contents_url":"https://api.github.com/repos/WP-API/OAuth2/contents/{+path}","compare_url":"https://api.github.com/repos/WP-API/OAuth2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WP-API/OAuth2/merges","archive_url":"https://api.github.com/repos/WP-API/OAuth2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WP-API/OAuth2/downloads","issues_url":"https://api.github.com/repos/WP-API/OAuth2/issues{/number}","pulls_url":"https://api.github.com/repos/WP-API/OAuth2/pulls{/number}","milestones_url":"https://api.github.com/repos/WP-API/OAuth2/milestones{/number}","notifications_url":"https://api.github.com/repos/WP-API/OAuth2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WP-API/OAuth2/labels{/name}","releases_url":"https://api.github.com/repos/WP-API/OAuth2/releases{/id}","deployments_url":"https://api.github.com/repos/WP-API/OAuth2/deployments","created_at":"2017-06-15T07:44:07Z","updated_at":"2017-06-30T10:04:22Z","pushed_at":"2017-07-01T06:05:23Z","git_url":"git://github.com/WP-API/OAuth2.git","ssh_url":"git@github.com:WP-API/OAuth2.git","clone_url":"https://github.com/WP-API/OAuth2.git","svn_url":"https://github.com/WP-API/OAuth2","homepage":null,"size":312,"stargazers_count":9,"watchers_count":9,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":0,"forks":3,"open_issues":0,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WP-API/OAuth2/pulls/8"},"html":{"href":"https://github.com/WP-API/OAuth2/pull/8"},"issue":{"href":"https://api.github.com/repos/WP-API/OAuth2/issues/8"},"comments":{"href":"https://api.github.com/repos/WP-API/OAuth2/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/WP-API/OAuth2/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/WP-API/OAuth2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WP-API/OAuth2/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/WP-API/OAuth2/statuses/9d274c01d11f1fa9556e9afad7eddc54569e2a46"}},"merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"rmccue","id":21655,"avatar_url":"https://avatars0.githubusercontent.com/u/21655?v=3","gravatar_id":"","url":"https://api.github.com/users/rmccue","html_url":"https://github.com/rmccue","followers_url":"https://api.github.com/users/rmccue/followers","following_url":"https://api.github.com/users/rmccue/following{/other_user}","gists_url":"https://api.github.com/users/rmccue/gists{/gist_id}","starred_url":"https://api.github.com/users/rmccue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmccue/subscriptions","organizations_url":"https://api.github.com/users/rmccue/orgs","repos_url":"https://api.github.com/users/rmccue/repos","events_url":"https://api.github.com/users/rmccue/events{/privacy}","received_events_url":"https://api.github.com/users/rmccue/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":214,"deletions":62,"changed_files":20}}
{"actor":{"display_login":"rmccue"}}