{"action":"created","comment":{"url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/pulls/comments/26618750","id":26618750,"diff_hunk":"@@ -2,8 +2,90 @@\n \n class Overpass2Geojson\n {\n+    /**\n+     * Converts a JSON string or decoded array into a GeoJSON string or array\n+     * @param  mixed   $input  JSON string or array\n+     * @param  boolean $encode whether to encode output as string\n+     * @return mixed           false if failed, otherwise GeoJSON string or array\n+     */\n+    public static function convert($input, $encode=true) {\n+        if (is_array($input)) {\n+            $inputArray = $input;\n+        } else if (is_string($input)) {\n+            $inputArray = json_decode($input, true);\n+        } else {\n+            return false;\n+        }\n+        if (!is_array($inputArray) ||\n+            !isset($inputArray['elements']) ||\n+            !is_array($inputArray['elements'])) {\n \n-    public static function convert($input) {\n-        return '';\n+            return false;\n+        }","path":"lib/Overpass2Geojson.php","position":25,"original_position":25,"commit_id":"49880d12ee9ce4b06b941191c954745166acfa18","original_commit_id":"49880d12ee9ce4b06b941191c954745166acfa18","user":{"login":"markstuart","id":1121256,"avatar_url":"https://avatars.githubusercontent.com/u/1121256?v=3","gravatar_id":"","url":"https://api.github.com/users/markstuart","html_url":"https://github.com/markstuart","followers_url":"https://api.github.com/users/markstuart/followers","following_url":"https://api.github.com/users/markstuart/following{/other_user}","gists_url":"https://api.github.com/users/markstuart/gists{/gist_id}","starred_url":"https://api.github.com/users/markstuart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstuart/subscriptions","organizations_url":"https://api.github.com/users/markstuart/orgs","repos_url":"https://api.github.com/users/markstuart/repos","events_url":"https://api.github.com/users/markstuart/events{/privacy}","received_events_url":"https://api.github.com/users/markstuart/received_events","type":"User","site_admin":false},"body":"Consider moving all the above into an input validation handling function","created_at":"2015-03-17T21:34:30Z","updated_at":"2015-03-17T21:34:30Z","html_url":"https://github.com/mediasuitenz/Overpass2Geojson/pull/1#discussion_r26618750","pull_request_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/pulls/comments/26618750"},"html":{"href":"https://github.com/mediasuitenz/Overpass2Geojson/pull/1#discussion_r26618750"},"pull_request":{"href":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/pulls/1","id":31293463,"html_url":"https://github.com/mediasuitenz/Overpass2Geojson/pull/1","diff_url":"https://github.com/mediasuitenz/Overpass2Geojson/pull/1.diff","patch_url":"https://github.com/mediasuitenz/Overpass2Geojson/pull/1.patch","issue_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/issues/1","number":1,"state":"open","locked":false,"title":"Add/conversion","user":{"login":"matt-in-a-hat","id":1852796,"avatar_url":"https://avatars.githubusercontent.com/u/1852796?v=3","gravatar_id":"","url":"https://api.github.com/users/matt-in-a-hat","html_url":"https://github.com/matt-in-a-hat","followers_url":"https://api.github.com/users/matt-in-a-hat/followers","following_url":"https://api.github.com/users/matt-in-a-hat/following{/other_user}","gists_url":"https://api.github.com/users/matt-in-a-hat/gists{/gist_id}","starred_url":"https://api.github.com/users/matt-in-a-hat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matt-in-a-hat/subscriptions","organizations_url":"https://api.github.com/users/matt-in-a-hat/orgs","repos_url":"https://api.github.com/users/matt-in-a-hat/repos","events_url":"https://api.github.com/users/matt-in-a-hat/events{/privacy}","received_events_url":"https://api.github.com/users/matt-in-a-hat/received_events","type":"User","site_admin":false},"body":"TODO\r\n- [x] Add README explaining that this module currently only handles converting ways to a collection of LineString features.\r\n- [ ] Push to packagist **(Will wait until this PR is merged though)**","created_at":"2015-03-16T23:05:23Z","updated_at":"2015-03-17T21:34:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7b2aad6de4c3b045ff01d1e0e9df5b760aa09371","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/pulls/1/commits","review_comments_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/pulls/1/comments","review_comment_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/issues/1/comments","statuses_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/statuses/49880d12ee9ce4b06b941191c954745166acfa18","head":{"label":"mediasuitenz:add/conversion","ref":"add/conversion","sha":"49880d12ee9ce4b06b941191c954745166acfa18","user":{"login":"mediasuitenz","id":4219296,"avatar_url":"https://avatars.githubusercontent.com/u/4219296?v=3","gravatar_id":"","url":"https://api.github.com/users/mediasuitenz","html_url":"https://github.com/mediasuitenz","followers_url":"https://api.github.com/users/mediasuitenz/followers","following_url":"https://api.github.com/users/mediasuitenz/following{/other_user}","gists_url":"https://api.github.com/users/mediasuitenz/gists{/gist_id}","starred_url":"https://api.github.com/users/mediasuitenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediasuitenz/subscriptions","organizations_url":"https://api.github.com/users/mediasuitenz/orgs","repos_url":"https://api.github.com/users/mediasuitenz/repos","events_url":"https://api.github.com/users/mediasuitenz/events{/privacy}","received_events_url":"https://api.github.com/users/mediasuitenz/received_events","type":"Organization","site_admin":false},"repo":{"id":32358069,"name":"Overpass2Geojson","full_name":"mediasuitenz/Overpass2Geojson","owner":{"login":"mediasuitenz","id":4219296,"avatar_url":"https://avatars.githubusercontent.com/u/4219296?v=3","gravatar_id":"","url":"https://api.github.com/users/mediasuitenz","html_url":"https://github.com/mediasuitenz","followers_url":"https://api.github.com/users/mediasuitenz/followers","following_url":"https://api.github.com/users/mediasuitenz/following{/other_user}","gists_url":"https://api.github.com/users/mediasuitenz/gists{/gist_id}","starred_url":"https://api.github.com/users/mediasuitenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediasuitenz/subscriptions","organizations_url":"https://api.github.com/users/mediasuitenz/orgs","repos_url":"https://api.github.com/users/mediasuitenz/repos","events_url":"https://api.github.com/users/mediasuitenz/events{/privacy}","received_events_url":"https://api.github.com/users/mediasuitenz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mediasuitenz/Overpass2Geojson","description":"Converts Overpass API JSON output to GeoJSON format","fork":false,"url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson","forks_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/forks","keys_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/teams","hooks_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/hooks","issue_events_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/issues/events{/number}","events_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/events","assignees_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/assignees{/user}","branches_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/branches{/branch}","tags_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/tags","blobs_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/git/refs{/sha}","trees_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/statuses/{sha}","languages_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/languages","stargazers_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/stargazers","contributors_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/contributors","subscribers_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/subscribers","subscription_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/subscription","commits_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/commits{/sha}","git_commits_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/git/commits{/sha}","comments_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/comments{/number}","issue_comment_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/issues/comments{/number}","contents_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/contents/{+path}","compare_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/merges","archive_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/downloads","issues_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/issues{/number}","pulls_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/pulls{/number}","milestones_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/milestones{/number}","notifications_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/labels{/name}","releases_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/releases{/id}","created_at":"2015-03-16T22:59:27Z","updated_at":"2015-03-17T04:28:08Z","pushed_at":"2015-03-17T04:32:27Z","git_url":"git://github.com/mediasuitenz/Overpass2Geojson.git","ssh_url":"git@github.com:mediasuitenz/Overpass2Geojson.git","clone_url":"https://github.com/mediasuitenz/Overpass2Geojson.git","svn_url":"https://github.com/mediasuitenz/Overpass2Geojson","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"mediasuitenz:master","ref":"master","sha":"81acdf1cc53132b6670ff36d0e3741fec1f77d19","user":{"login":"mediasuitenz","id":4219296,"avatar_url":"https://avatars.githubusercontent.com/u/4219296?v=3","gravatar_id":"","url":"https://api.github.com/users/mediasuitenz","html_url":"https://github.com/mediasuitenz","followers_url":"https://api.github.com/users/mediasuitenz/followers","following_url":"https://api.github.com/users/mediasuitenz/following{/other_user}","gists_url":"https://api.github.com/users/mediasuitenz/gists{/gist_id}","starred_url":"https://api.github.com/users/mediasuitenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediasuitenz/subscriptions","organizations_url":"https://api.github.com/users/mediasuitenz/orgs","repos_url":"https://api.github.com/users/mediasuitenz/repos","events_url":"https://api.github.com/users/mediasuitenz/events{/privacy}","received_events_url":"https://api.github.com/users/mediasuitenz/received_events","type":"Organization","site_admin":false},"repo":{"id":32358069,"name":"Overpass2Geojson","full_name":"mediasuitenz/Overpass2Geojson","owner":{"login":"mediasuitenz","id":4219296,"avatar_url":"https://avatars.githubusercontent.com/u/4219296?v=3","gravatar_id":"","url":"https://api.github.com/users/mediasuitenz","html_url":"https://github.com/mediasuitenz","followers_url":"https://api.github.com/users/mediasuitenz/followers","following_url":"https://api.github.com/users/mediasuitenz/following{/other_user}","gists_url":"https://api.github.com/users/mediasuitenz/gists{/gist_id}","starred_url":"https://api.github.com/users/mediasuitenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediasuitenz/subscriptions","organizations_url":"https://api.github.com/users/mediasuitenz/orgs","repos_url":"https://api.github.com/users/mediasuitenz/repos","events_url":"https://api.github.com/users/mediasuitenz/events{/privacy}","received_events_url":"https://api.github.com/users/mediasuitenz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mediasuitenz/Overpass2Geojson","description":"Converts Overpass API JSON output to GeoJSON format","fork":false,"url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson","forks_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/forks","keys_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/teams","hooks_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/hooks","issue_events_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/issues/events{/number}","events_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/events","assignees_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/assignees{/user}","branches_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/branches{/branch}","tags_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/tags","blobs_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/git/refs{/sha}","trees_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/statuses/{sha}","languages_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/languages","stargazers_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/stargazers","contributors_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/contributors","subscribers_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/subscribers","subscription_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/subscription","commits_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/commits{/sha}","git_commits_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/git/commits{/sha}","comments_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/comments{/number}","issue_comment_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/issues/comments{/number}","contents_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/contents/{+path}","compare_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/merges","archive_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/downloads","issues_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/issues{/number}","pulls_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/pulls{/number}","milestones_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/milestones{/number}","notifications_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/labels{/name}","releases_url":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/releases{/id}","created_at":"2015-03-16T22:59:27Z","updated_at":"2015-03-17T04:28:08Z","pushed_at":"2015-03-17T04:32:27Z","git_url":"git://github.com/mediasuitenz/Overpass2Geojson.git","ssh_url":"git@github.com:mediasuitenz/Overpass2Geojson.git","clone_url":"https://github.com/mediasuitenz/Overpass2Geojson.git","svn_url":"https://github.com/mediasuitenz/Overpass2Geojson","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/pulls/1"},"html":{"href":"https://github.com/mediasuitenz/Overpass2Geojson/pull/1"},"issue":{"href":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/issues/1"},"comments":{"href":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/mediasuitenz/Overpass2Geojson/statuses/49880d12ee9ce4b06b941191c954745166acfa18"}}}}