Skip to content
This repository has been archived by the owner on Dec 3, 2022. It is now read-only.

Commit

Permalink
Fixed some of the error handling code
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony-mills committed Feb 3, 2012
1 parent 9231202 commit 024d2b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions googlePlaces.php
Expand Up @@ -108,11 +108,11 @@ protected function _checkErrors()
$this->_errors[] = "API Call Type is required but is missing.";
}

if(empty($this->APIKey)) {
if(empty($this->_apiKey)) {
$this->_errors[] = "API Key is is required but is missing.";
}

if(($this->OutputType!="json") && ($this->OutputType!="xml") && ($this->OutputType!="json")) {
if(($this->_outputType!="json") && ($this->outputType!="xml") && ($this->outputType!="json")) {
$this->_errors[] = "OutputType is required but is missing.";
}
}
Expand Down Expand Up @@ -162,7 +162,7 @@ protected function _apiCall()

$URLToCall = $this->_apiUrl."/".$this->_apiCallType."/".$this->_outputType."?key=".$this->_apiKey."&".$URLparams;
$result = json_decode(file_get_contents($URLToCall),true);
$result['errors'] = $this->Errors;
$result['errors'] = $this->_errors;

if($result[status]=="OK" && $this->_apiCallType=="details") {
foreach($result[result][address_components] as $key=>$component) {
Expand Down

0 comments on commit 024d2b5

Please sign in to comment.