{"action":"created","comment":{"url":"https://api.github.com/repos/Respect/Validation/pulls/comments/29578703","id":29578703,"diff_hunk":"@@ -5,6 +5,10 @@ class NoWhitespace extends AbstractRule\n {\n     public function validate($input)\n     {\n+        if (is_array($input)) {\n+            return false;\n+        }\n+\n         return is_null($input) || !preg_match('#\\s#', $input);","path":"library/Rules/NoWhitespace.php","position":8,"original_position":8,"commit_id":"1eec4a067be93220dab1e4e6283c7ce9a105ddcf","original_commit_id":"1eec4a067be93220dab1e4e6283c7ce9a105ddcf","user":{"login":"henriquemoody","id":154023,"avatar_url":"https://avatars.githubusercontent.com/u/154023?v=3","gravatar_id":"","url":"https://api.github.com/users/henriquemoody","html_url":"https://github.com/henriquemoody","followers_url":"https://api.github.com/users/henriquemoody/followers","following_url":"https://api.github.com/users/henriquemoody/following{/other_user}","gists_url":"https://api.github.com/users/henriquemoody/gists{/gist_id}","starred_url":"https://api.github.com/users/henriquemoody/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henriquemoody/subscriptions","organizations_url":"https://api.github.com/users/henriquemoody/orgs","repos_url":"https://api.github.com/users/henriquemoody/repos","events_url":"https://api.github.com/users/henriquemoody/events{/privacy}","received_events_url":"https://api.github.com/users/henriquemoody/received_events","type":"User","site_admin":false},"body":"I guess it's better to use `(is_scalar($input) && preg_match(..` instead of the checking above. What you think?\r\n\r\n","created_at":"2015-05-04T11:45:08Z","updated_at":"2015-05-04T11:45:08Z","html_url":"https://github.com/Respect/Validation/pull/347#discussion_r29578703","pull_request_url":"https://api.github.com/repos/Respect/Validation/pulls/347","_links":{"self":{"href":"https://api.github.com/repos/Respect/Validation/pulls/comments/29578703"},"html":{"href":"https://github.com/Respect/Validation/pull/347#discussion_r29578703"},"pull_request":{"href":"https://api.github.com/repos/Respect/Validation/pulls/347"}}},"pull_request":{"url":"https://api.github.com/repos/Respect/Validation/pulls/347","id":34604010,"html_url":"https://github.com/Respect/Validation/pull/347","diff_url":"https://github.com/Respect/Validation/pull/347.diff","patch_url":"https://github.com/Respect/Validation/pull/347.patch","issue_url":"https://api.github.com/repos/Respect/Validation/issues/347","number":347,"state":"open","locked":false,"title":"Prevents noWithespace from failing validating arrays","user":{"login":"augustohp","id":188613,"avatar_url":"https://avatars.githubusercontent.com/u/188613?v=3","gravatar_id":"","url":"https://api.github.com/users/augustohp","html_url":"https://github.com/augustohp","followers_url":"https://api.github.com/users/augustohp/followers","following_url":"https://api.github.com/users/augustohp/following{/other_user}","gists_url":"https://api.github.com/users/augustohp/gists{/gist_id}","starred_url":"https://api.github.com/users/augustohp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/augustohp/subscriptions","organizations_url":"https://api.github.com/users/augustohp/orgs","repos_url":"https://api.github.com/users/augustohp/repos","events_url":"https://api.github.com/users/augustohp/events{/privacy}","received_events_url":"https://api.github.com/users/augustohp/received_events","type":"User","site_admin":false},"body":"A warning was thrown because of the preg_match call, as not every input\r\nis a string we prevent calls from arrays going further into checking.\r\n\r\nIssue #346","created_at":"2015-05-03T16:56:59Z","updated_at":"2015-05-04T11:45:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ca46265a989d7a88072e8ffb6f41ac85c874120c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Respect/Validation/pulls/347/commits","review_comments_url":"https://api.github.com/repos/Respect/Validation/pulls/347/comments","review_comment_url":"https://api.github.com/repos/Respect/Validation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Respect/Validation/issues/347/comments","statuses_url":"https://api.github.com/repos/Respect/Validation/statuses/1eec4a067be93220dab1e4e6283c7ce9a105ddcf","head":{"label":"Respect:issue/346-withespace-warning","ref":"issue/346-withespace-warning","sha":"1eec4a067be93220dab1e4e6283c7ce9a105ddcf","user":{"login":"Respect","id":354431,"avatar_url":"https://avatars.githubusercontent.com/u/354431?v=3","gravatar_id":"","url":"https://api.github.com/users/Respect","html_url":"https://github.com/Respect","followers_url":"https://api.github.com/users/Respect/followers","following_url":"https://api.github.com/users/Respect/following{/other_user}","gists_url":"https://api.github.com/users/Respect/gists{/gist_id}","starred_url":"https://api.github.com/users/Respect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Respect/subscriptions","organizations_url":"https://api.github.com/users/Respect/orgs","repos_url":"https://api.github.com/users/Respect/repos","events_url":"https://api.github.com/users/Respect/events{/privacy}","received_events_url":"https://api.github.com/users/Respect/received_events","type":"Organization","site_admin":false},"repo":{"id":931033,"name":"Validation","full_name":"Respect/Validation","owner":{"login":"Respect","id":354431,"avatar_url":"https://avatars.githubusercontent.com/u/354431?v=3","gravatar_id":"","url":"https://api.github.com/users/Respect","html_url":"https://github.com/Respect","followers_url":"https://api.github.com/users/Respect/followers","following_url":"https://api.github.com/users/Respect/following{/other_user}","gists_url":"https://api.github.com/users/Respect/gists{/gist_id}","starred_url":"https://api.github.com/users/Respect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Respect/subscriptions","organizations_url":"https://api.github.com/users/Respect/orgs","repos_url":"https://api.github.com/users/Respect/repos","events_url":"https://api.github.com/users/Respect/events{/privacy}","received_events_url":"https://api.github.com/users/Respect/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Respect/Validation","description":"The most awesome validation engine ever created for PHP","fork":false,"url":"https://api.github.com/repos/Respect/Validation","forks_url":"https://api.github.com/repos/Respect/Validation/forks","keys_url":"https://api.github.com/repos/Respect/Validation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Respect/Validation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Respect/Validation/teams","hooks_url":"https://api.github.com/repos/Respect/Validation/hooks","issue_events_url":"https://api.github.com/repos/Respect/Validation/issues/events{/number}","events_url":"https://api.github.com/repos/Respect/Validation/events","assignees_url":"https://api.github.com/repos/Respect/Validation/assignees{/user}","branches_url":"https://api.github.com/repos/Respect/Validation/branches{/branch}","tags_url":"https://api.github.com/repos/Respect/Validation/tags","blobs_url":"https://api.github.com/repos/Respect/Validation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Respect/Validation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Respect/Validation/git/refs{/sha}","trees_url":"https://api.github.com/repos/Respect/Validation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Respect/Validation/statuses/{sha}","languages_url":"https://api.github.com/repos/Respect/Validation/languages","stargazers_url":"https://api.github.com/repos/Respect/Validation/stargazers","contributors_url":"https://api.github.com/repos/Respect/Validation/contributors","subscribers_url":"https://api.github.com/repos/Respect/Validation/subscribers","subscription_url":"https://api.github.com/repos/Respect/Validation/subscription","commits_url":"https://api.github.com/repos/Respect/Validation/commits{/sha}","git_commits_url":"https://api.github.com/repos/Respect/Validation/git/commits{/sha}","comments_url":"https://api.github.com/repos/Respect/Validation/comments{/number}","issue_comment_url":"https://api.github.com/repos/Respect/Validation/issues/comments{/number}","contents_url":"https://api.github.com/repos/Respect/Validation/contents/{+path}","compare_url":"https://api.github.com/repos/Respect/Validation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Respect/Validation/merges","archive_url":"https://api.github.com/repos/Respect/Validation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Respect/Validation/downloads","issues_url":"https://api.github.com/repos/Respect/Validation/issues{/number}","pulls_url":"https://api.github.com/repos/Respect/Validation/pulls{/number}","milestones_url":"https://api.github.com/repos/Respect/Validation/milestones{/number}","notifications_url":"https://api.github.com/repos/Respect/Validation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Respect/Validation/labels{/name}","releases_url":"https://api.github.com/repos/Respect/Validation/releases{/id}","created_at":"2010-09-22T16:08:05Z","updated_at":"2015-05-04T10:25:08Z","pushed_at":"2015-05-03T16:56:59Z","git_url":"git://github.com/Respect/Validation.git","ssh_url":"git@github.com:Respect/Validation.git","clone_url":"https://github.com/Respect/Validation.git","svn_url":"https://github.com/Respect/Validation","homepage":"http://respect.li/Validation","size":6543,"stargazers_count":2263,"watchers_count":2263,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":317,"mirror_url":null,"open_issues_count":28,"forks":317,"open_issues":28,"watchers":2263,"default_branch":"master"}},"base":{"label":"Respect:master","ref":"master","sha":"9c5591f9b877334a652ca5d4f65a32376c3a7da0","user":{"login":"Respect","id":354431,"avatar_url":"https://avatars.githubusercontent.com/u/354431?v=3","gravatar_id":"","url":"https://api.github.com/users/Respect","html_url":"https://github.com/Respect","followers_url":"https://api.github.com/users/Respect/followers","following_url":"https://api.github.com/users/Respect/following{/other_user}","gists_url":"https://api.github.com/users/Respect/gists{/gist_id}","starred_url":"https://api.github.com/users/Respect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Respect/subscriptions","organizations_url":"https://api.github.com/users/Respect/orgs","repos_url":"https://api.github.com/users/Respect/repos","events_url":"https://api.github.com/users/Respect/events{/privacy}","received_events_url":"https://api.github.com/users/Respect/received_events","type":"Organization","site_admin":false},"repo":{"id":931033,"name":"Validation","full_name":"Respect/Validation","owner":{"login":"Respect","id":354431,"avatar_url":"https://avatars.githubusercontent.com/u/354431?v=3","gravatar_id":"","url":"https://api.github.com/users/Respect","html_url":"https://github.com/Respect","followers_url":"https://api.github.com/users/Respect/followers","following_url":"https://api.github.com/users/Respect/following{/other_user}","gists_url":"https://api.github.com/users/Respect/gists{/gist_id}","starred_url":"https://api.github.com/users/Respect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Respect/subscriptions","organizations_url":"https://api.github.com/users/Respect/orgs","repos_url":"https://api.github.com/users/Respect/repos","events_url":"https://api.github.com/users/Respect/events{/privacy}","received_events_url":"https://api.github.com/users/Respect/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Respect/Validation","description":"The most awesome validation engine ever created for PHP","fork":false,"url":"https://api.github.com/repos/Respect/Validation","forks_url":"https://api.github.com/repos/Respect/Validation/forks","keys_url":"https://api.github.com/repos/Respect/Validation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Respect/Validation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Respect/Validation/teams","hooks_url":"https://api.github.com/repos/Respect/Validation/hooks","issue_events_url":"https://api.github.com/repos/Respect/Validation/issues/events{/number}","events_url":"https://api.github.com/repos/Respect/Validation/events","assignees_url":"https://api.github.com/repos/Respect/Validation/assignees{/user}","branches_url":"https://api.github.com/repos/Respect/Validation/branches{/branch}","tags_url":"https://api.github.com/repos/Respect/Validation/tags","blobs_url":"https://api.github.com/repos/Respect/Validation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Respect/Validation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Respect/Validation/git/refs{/sha}","trees_url":"https://api.github.com/repos/Respect/Validation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Respect/Validation/statuses/{sha}","languages_url":"https://api.github.com/repos/Respect/Validation/languages","stargazers_url":"https://api.github.com/repos/Respect/Validation/stargazers","contributors_url":"https://api.github.com/repos/Respect/Validation/contributors","subscribers_url":"https://api.github.com/repos/Respect/Validation/subscribers","subscription_url":"https://api.github.com/repos/Respect/Validation/subscription","commits_url":"https://api.github.com/repos/Respect/Validation/commits{/sha}","git_commits_url":"https://api.github.com/repos/Respect/Validation/git/commits{/sha}","comments_url":"https://api.github.com/repos/Respect/Validation/comments{/number}","issue_comment_url":"https://api.github.com/repos/Respect/Validation/issues/comments{/number}","contents_url":"https://api.github.com/repos/Respect/Validation/contents/{+path}","compare_url":"https://api.github.com/repos/Respect/Validation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Respect/Validation/merges","archive_url":"https://api.github.com/repos/Respect/Validation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Respect/Validation/downloads","issues_url":"https://api.github.com/repos/Respect/Validation/issues{/number}","pulls_url":"https://api.github.com/repos/Respect/Validation/pulls{/number}","milestones_url":"https://api.github.com/repos/Respect/Validation/milestones{/number}","notifications_url":"https://api.github.com/repos/Respect/Validation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Respect/Validation/labels{/name}","releases_url":"https://api.github.com/repos/Respect/Validation/releases{/id}","created_at":"2010-09-22T16:08:05Z","updated_at":"2015-05-04T10:25:08Z","pushed_at":"2015-05-03T16:56:59Z","git_url":"git://github.com/Respect/Validation.git","ssh_url":"git@github.com:Respect/Validation.git","clone_url":"https://github.com/Respect/Validation.git","svn_url":"https://github.com/Respect/Validation","homepage":"http://respect.li/Validation","size":6543,"stargazers_count":2263,"watchers_count":2263,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":317,"mirror_url":null,"open_issues_count":28,"forks":317,"open_issues":28,"watchers":2263,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Respect/Validation/pulls/347"},"html":{"href":"https://github.com/Respect/Validation/pull/347"},"issue":{"href":"https://api.github.com/repos/Respect/Validation/issues/347"},"comments":{"href":"https://api.github.com/repos/Respect/Validation/issues/347/comments"},"review_comments":{"href":"https://api.github.com/repos/Respect/Validation/pulls/347/comments"},"review_comment":{"href":"https://api.github.com/repos/Respect/Validation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Respect/Validation/pulls/347/commits"},"statuses":{"href":"https://api.github.com/repos/Respect/Validation/statuses/1eec4a067be93220dab1e4e6283c7ce9a105ddcf"}}}}