GitHub PullRequestReviewCommentEvent at 2014-07-16 14:24:45
Repository: util-php
Actor: nubs
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/dominionenterprises/util-php/pulls/comments/15000057","id":15000057,"diff_hunk":"@@ -289,4 +289,24 @@ public static function extract(array $input, $keyIndex, $valueIndex, $duplicateB\n \n         return $result;\n     }\n+\n+    /**\n+     * Returns the first non-null value specified by the given array of keys.\n+     *\n+     * @param array $array The array containing the possible values.\n+     * @param array $keys Array of keys to search for. The first non-null value will be returned.\n+     * @param mixed $default The default value to return if no non-null values were found in the array.\n+     *\n+     * @return mixed.","path":"src/Util/Arrays.php","position":12,"original_position":12,"commit_id":"c8466f97f929de3c8e3866e2d705be8f0b4c2974","original_commit_id":"c8466f97f929de3c8e3866e2d705be8f0b4c2974","user":{"login":"nubs","id":57673,"avatar_url":"https://avatars.githubusercontent.com/u/57673?","gravatar_id":"8432b3700f25faff657aef27a76d4e55","url":"https://api.github.com/users/nubs","html_url":"https://github.com/nubs","followers_url":"https://api.github.com/users/nubs/followers","following_url":"https://api.github.com/users/nubs/following{/other_user}","gists_url":"https://api.github.com/users/nubs/gists{/gist_id}","starred_url":"https://api.github.com/users/nubs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nubs/subscriptions","organizations_url":"https://api.github.com/users/nubs/orgs","repos_url":"https://api.github.com/users/nubs/repos","events_url":"https://api.github.com/users/nubs/events{/privacy}","received_events_url":"https://api.github.com/users/nubs/received_events","type":"User","site_admin":false},"body":"sorry, the period `.` after the word mixed will show up in the docblocks IIRC.  I should have been more clear about that being the main issue here.","created_at":"2014-07-16T14:24:45Z","updated_at":"2014-07-16T14:24:45Z","html_url":"https://github.com/dominionenterprises/util-php/pull/35#discussion_r15000057","pull_request_url":"https://api.github.com/repos/dominionenterprises/util-php/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/dominionenterprises/util-php/pulls/comments/15000057"},"html":{"href":"https://github.com/dominionenterprises/util-php/pull/35#discussion_r15000057"},"pull_request":{"href":"https://api.github.com/repos/dominionenterprises/util-php/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/dominionenterprises/util-php/pulls/35","id":18376298,"html_url":"https://github.com/dominionenterprises/util-php/pull/35","diff_url":"https://github.com/dominionenterprises/util-php/pull/35.diff","patch_url":"https://github.com/dominionenterprises/util-php/pull/35.patch","issue_url":"https://api.github.com/repos/dominionenterprises/util-php/issues/35","number":35,"state":"open","title":"Add Arrays::getFirstIfSet","user":{"login":"chadicus","id":1182337,"avatar_url":"https://avatars.githubusercontent.com/u/1182337?","gravatar_id":"6e454db1e06d787bffb88f255eb95f8f","url":"https://api.github.com/users/chadicus","html_url":"https://github.com/chadicus","followers_url":"https://api.github.com/users/chadicus/followers","following_url":"https://api.github.com/users/chadicus/following{/other_user}","gists_url":"https://api.github.com/users/chadicus/gists{/gist_id}","starred_url":"https://api.github.com/users/chadicus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chadicus/subscriptions","organizations_url":"https://api.github.com/users/chadicus/orgs","repos_url":"https://api.github.com/users/chadicus/repos","events_url":"https://api.github.com/users/chadicus/events{/privacy}","received_events_url":"https://api.github.com/users/chadicus/received_events","type":"User","site_admin":false},"body":"Use case: I want to select the value of `username` if it is not null or select the value of `email` otherwise generate a unique username for the user.\r\n\r\n```php\r\n$post = ['username' => null, 'email' => 'chadicus@example.com', 'password' => 'secret'];\r\n$username = Arrays::getOne($post, ['username', 'email'], generateUsername());\r\n```\r\n\r\nLet me know if you have any questions.","created_at":"2014-07-14T21:46:03Z","updated_at":"2014-07-16T14:24:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"208ce6a401ae2212b99b045397c32bb1abb6631e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dominionenterprises/util-php/pulls/35/commits","review_comments_url":"https://api.github.com/repos/dominionenterprises/util-php/pulls/35/comments","review_comment_url":"https://api.github.com/repos/dominionenterprises/util-php/pulls/comments/{number}","comments_url":"https://api.github.com/repos/dominionenterprises/util-php/issues/35/comments","statuses_url":"https://api.github.com/repos/dominionenterprises/util-php/statuses/c8466f97f929de3c8e3866e2d705be8f0b4c2974","head":{"label":"chadicus:master","ref":"master","sha":"c8466f97f929de3c8e3866e2d705be8f0b4c2974","user":{"login":"chadicus","id":1182337,"avatar_url":"https://avatars.githubusercontent.com/u/1182337?","gravatar_id":"6e454db1e06d787bffb88f255eb95f8f","url":"https://api.github.com/users/chadicus","html_url":"https://github.com/chadicus","followers_url":"https://api.github.com/users/chadicus/followers","following_url":"https://api.github.com/users/chadicus/following{/other_user}","gists_url":"https://api.github.com/users/chadicus/gists{/gist_id}","starred_url":"https://api.github.com/users/chadicus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chadicus/subscriptions","organizations_url":"https://api.github.com/users/chadicus/orgs","repos_url":"https://api.github.com/users/chadicus/repos","events_url":"https://api.github.com/users/chadicus/events{/privacy}","received_events_url":"https://api.github.com/users/chadicus/received_events","type":"User","site_admin":false},"repo":{"id":12688583,"name":"util-php","full_name":"chadicus/util-php","owner":{"login":"chadicus","id":1182337,"avatar_url":"https://avatars.githubusercontent.com/u/1182337?","gravatar_id":"6e454db1e06d787bffb88f255eb95f8f","url":"https://api.github.com/users/chadicus","html_url":"https://github.com/chadicus","followers_url":"https://api.github.com/users/chadicus/followers","following_url":"https://api.github.com/users/chadicus/following{/other_user}","gists_url":"https://api.github.com/users/chadicus/gists{/gist_id}","starred_url":"https://api.github.com/users/chadicus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chadicus/subscriptions","organizations_url":"https://api.github.com/users/chadicus/orgs","repos_url":"https://api.github.com/users/chadicus/repos","events_url":"https://api.github.com/users/chadicus/events{/privacy}","received_events_url":"https://api.github.com/users/chadicus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chadicus/util-php","description":"Library of PHP utility classes","fork":true,"url":"https://api.github.com/repos/chadicus/util-php","forks_url":"https://api.github.com/repos/chadicus/util-php/forks","keys_url":"https://api.github.com/repos/chadicus/util-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chadicus/util-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chadicus/util-php/teams","hooks_url":"https://api.github.com/repos/chadicus/util-php/hooks","issue_events_url":"https://api.github.com/repos/chadicus/util-php/issues/events{/number}","events_url":"https://api.github.com/repos/chadicus/util-php/events","assignees_url":"https://api.github.com/repos/chadicus/util-php/assignees{/user}","branches_url":"https://api.github.com/repos/chadicus/util-php/branches{/branch}","tags_url":"https://api.github.com/repos/chadicus/util-php/tags","blobs_url":"https://api.github.com/repos/chadicus/util-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chadicus/util-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chadicus/util-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/chadicus/util-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chadicus/util-php/statuses/{sha}","languages_url":"https://api.github.com/repos/chadicus/util-php/languages","stargazers_url":"https://api.github.com/repos/chadicus/util-php/stargazers","contributors_url":"https://api.github.com/repos/chadicus/util-php/contributors","subscribers_url":"https://api.github.com/repos/chadicus/util-php/subscribers","subscription_url":"https://api.github.com/repos/chadicus/util-php/subscription","commits_url":"https://api.github.com/repos/chadicus/util-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/chadicus/util-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/chadicus/util-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/chadicus/util-php/issues/comments/{number}","contents_url":"https://api.github.com/repos/chadicus/util-php/contents/{+path}","compare_url":"https://api.github.com/repos/chadicus/util-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chadicus/util-php/merges","archive_url":"https://api.github.com/repos/chadicus/util-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chadicus/util-php/downloads","issues_url":"https://api.github.com/repos/chadicus/util-php/issues{/number}","pulls_url":"https://api.github.com/repos/chadicus/util-php/pulls{/number}","milestones_url":"https://api.github.com/repos/chadicus/util-php/milestones{/number}","notifications_url":"https://api.github.com/repos/chadicus/util-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chadicus/util-php/labels{/name}","releases_url":"https://api.github.com/repos/chadicus/util-php/releases{/id}","created_at":"2013-09-08T22:19:22Z","updated_at":"2014-07-14T21:36:37Z","pushed_at":"2014-07-16T14:13:49Z","git_url":"git://github.com/chadicus/util-php.git","ssh_url":"git@github.com:chadicus/util-php.git","clone_url":"https://github.com/chadicus/util-php.git","svn_url":"https://github.com/chadicus/util-php","homepage":null,"size":1108,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dominionenterprises:master","ref":"master","sha":"8c07a8382aa8b2c69daf920d150d66c45a63b0e7","user":{"login":"dominionenterprises","id":1427024,"avatar_url":"https://avatars.githubusercontent.com/u/1427024?","gravatar_id":null,"url":"https://api.github.com/users/dominionenterprises","html_url":"https://github.com/dominionenterprises","followers_url":"https://api.github.com/users/dominionenterprises/followers","following_url":"https://api.github.com/users/dominionenterprises/following{/other_user}","gists_url":"https://api.github.com/users/dominionenterprises/gists{/gist_id}","starred_url":"https://api.github.com/users/dominionenterprises/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominionenterprises/subscriptions","organizations_url":"https://api.github.com/users/dominionenterprises/orgs","repos_url":"https://api.github.com/users/dominionenterprises/repos","events_url":"https://api.github.com/users/dominionenterprises/events{/privacy}","received_events_url":"https://api.github.com/users/dominionenterprises/received_events","type":"Organization","site_admin":false},"repo":{"id":12688581,"name":"util-php","full_name":"dominionenterprises/util-php","owner":{"login":"dominionenterprises","id":1427024,"avatar_url":"https://avatars.githubusercontent.com/u/1427024?","gravatar_id":null,"url":"https://api.github.com/users/dominionenterprises","html_url":"https://github.com/dominionenterprises","followers_url":"https://api.github.com/users/dominionenterprises/followers","following_url":"https://api.github.com/users/dominionenterprises/following{/other_user}","gists_url":"https://api.github.com/users/dominionenterprises/gists{/gist_id}","starred_url":"https://api.github.com/users/dominionenterprises/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominionenterprises/subscriptions","organizations_url":"https://api.github.com/users/dominionenterprises/orgs","repos_url":"https://api.github.com/users/dominionenterprises/repos","events_url":"https://api.github.com/users/dominionenterprises/events{/privacy}","received_events_url":"https://api.github.com/users/dominionenterprises/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dominionenterprises/util-php","description":"Library of PHP utility classes","fork":false,"url":"https://api.github.com/repos/dominionenterprises/util-php","forks_url":"https://api.github.com/repos/dominionenterprises/util-php/forks","keys_url":"https://api.github.com/repos/dominionenterprises/util-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dominionenterprises/util-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dominionenterprises/util-php/teams","hooks_url":"https://api.github.com/repos/dominionenterprises/util-php/hooks","issue_events_url":"https://api.github.com/repos/dominionenterprises/util-php/issues/events{/number}","events_url":"https://api.github.com/repos/dominionenterprises/util-php/events","assignees_url":"https://api.github.com/repos/dominionenterprises/util-php/assignees{/user}","branches_url":"https://api.github.com/repos/dominionenterprises/util-php/branches{/branch}","tags_url":"https://api.github.com/repos/dominionenterprises/util-php/tags","blobs_url":"https://api.github.com/repos/dominionenterprises/util-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dominionenterprises/util-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dominionenterprises/util-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/dominionenterprises/util-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dominionenterprises/util-php/statuses/{sha}","languages_url":"https://api.github.com/repos/dominionenterprises/util-php/languages","stargazers_url":"https://api.github.com/repos/dominionenterprises/util-php/stargazers","contributors_url":"https://api.github.com/repos/dominionenterprises/util-php/contributors","subscribers_url":"https://api.github.com/repos/dominionenterprises/util-php/subscribers","subscription_url":"https://api.github.com/repos/dominionenterprises/util-php/subscription","commits_url":"https://api.github.com/repos/dominionenterprises/util-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/dominionenterprises/util-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/dominionenterprises/util-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/dominionenterprises/util-php/issues/comments/{number}","contents_url":"https://api.github.com/repos/dominionenterprises/util-php/contents/{+path}","compare_url":"https://api.github.com/repos/dominionenterprises/util-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dominionenterprises/util-php/merges","archive_url":"https://api.github.com/repos/dominionenterprises/util-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dominionenterprises/util-php/downloads","issues_url":"https://api.github.com/repos/dominionenterprises/util-php/issues{/number}","pulls_url":"https://api.github.com/repos/dominionenterprises/util-php/pulls{/number}","milestones_url":"https://api.github.com/repos/dominionenterprises/util-php/milestones{/number}","notifications_url":"https://api.github.com/repos/dominionenterprises/util-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dominionenterprises/util-php/labels{/name}","releases_url":"https://api.github.com/repos/dominionenterprises/util-php/releases{/id}","created_at":"2013-09-08T22:19:15Z","updated_at":"2014-06-30T21:01:24Z","pushed_at":"2014-06-30T20:54:47Z","git_url":"git://github.com/dominionenterprises/util-php.git","ssh_url":"git@github.com:dominionenterprises/util-php.git","clone_url":"https://github.com/dominionenterprises/util-php.git","svn_url":"https://github.com/dominionenterprises/util-php","homepage":null,"size":874,"stargazers_count":5,"watchers_count":5,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":5,"mirror_url":null,"open_issues_count":1,"forks":5,"open_issues":1,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dominionenterprises/util-php/pulls/35"},"html":{"href":"https://github.com/dominionenterprises/util-php/pull/35"},"issue":{"href":"https://api.github.com/repos/dominionenterprises/util-php/issues/35"},"comments":{"href":"https://api.github.com/repos/dominionenterprises/util-php/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/dominionenterprises/util-php/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/dominionenterprises/util-php/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/dominionenterprises/util-php/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/dominionenterprises/util-php/statuses/c8466f97f929de3c8e3866e2d705be8f0b4c2974"}}}}