PhpStorm and Google APIs
How to correctly configure PhpStorm so that it doesn't show undefined field for every usage of Google APIs? For example, this code:
$request = "http://maps.google.com/maps/geo?output=json&oe=utf8&sensor=false&q=".urlencode("\"$name\" in {$row['City']}, {$row['State']}, {$row['ZipCode']}");
$response = json_decode(file_get_contents($request));
if ($response && $response->Status->code == 200) {
$lat = $response->Placemark[0]->Point->coordinates[1];
$lng = $response->Placemark[0]->Point->coordinates[0];
It invokes Google Maps API and the $response holds a valid response structure according to Google Maps API documentation. But PhpStorm complains that Status and Point fields are undefined.
I'd like to propose the feature to integrate the knowledge of standard Google APIs into PhpStorm or (even better) make it a generic solution so that I can include such web services manually. I want to have a useful autocomplete instead of wrong errors here.
http://youtrack.jetbrains.net/issue/WI-1603
Please sign in to leave a comment.