@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * @inheritdoc |
| 19 | 19 | */ |
| 20 | - protected function setupRequest() { |
|
| 20 | + protected function setupRequest(){ |
|
| 21 | 21 | $this->Request = new GETFile(); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * @inheritdoc |
| 26 | 26 | * File Response Object has option File Destination parameter, which is passed using DownloadDir property |
| 27 | 27 | */ |
| 28 | - protected function setupResponse() { |
|
| 28 | + protected function setupResponse(){ |
|
| 29 | 29 | $this->Response = new FileResponse($this->Request->getResponse(),$this->Request->getCurlObject(),$this->downloadDir); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | /** |
| 11 | 11 | * @inheritdoc |
| 12 | 12 | */ |
| 13 | - protected function setupRequest() { |
|
| 13 | + protected function setupRequest(){ |
|
| 14 | 14 | $this->Request = new POSTFile(); |
| 15 | 15 | } |
| 16 | 16 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | print_r($response); |
| 14 | 14 | |
| 15 | -}catch(\SugarAPI\SDK\Exception\AuthenticationException $ex){ |
|
| 15 | +} catch(\SugarAPI\SDK\Exception\AuthenticationException $ex){ |
|
| 16 | 16 | print $ex->getMessage(); |
| 17 | 17 | } |
| 18 | 18 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | print_r($response); |
| 14 | 14 | |
| 15 | -}catch (\SugarAPI\SDK\Exception\AuthenticationException $ex){ |
|
| 15 | +} catch (\SugarAPI\SDK\Exception\AuthenticationException $ex){ |
|
| 16 | 16 | print $ex->getMessage(); |
| 17 | 17 | } |
| 18 | 18 | |
@@ -15,18 +15,18 @@ |
||
| 15 | 15 | if ($response->getStatus()=='200'){ |
| 16 | 16 | $record = $response->getBody(); |
| 17 | 17 | print_r($record); |
| 18 | - }else{ |
|
| 18 | + } else{ |
|
| 19 | 19 | print_r($upload->getRequest()); |
| 20 | 20 | echo "Failed to Update Note with File<br>"; |
| 21 | 21 | echo "Response: ".$response->getStatus()."<br>"; |
| 22 | 22 | print_r($response->getBody()); |
| 23 | 23 | } |
| 24 | - }else{ |
|
| 24 | + } else{ |
|
| 25 | 25 | echo "Failed to create Note<br>"; |
| 26 | 26 | echo "Response: ".$response->getStatus()."<br>"; |
| 27 | 27 | print_r($response->getBody()); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | -}catch (\SugarAPI\SDK\Exception\SDKException $ex){ |
|
| 30 | +} catch (\SugarAPI\SDK\Exception\SDKException $ex){ |
|
| 31 | 31 | print $ex->getMessage(); |
| 32 | 32 | } |
| 33 | 33 | \ No newline at end of file |
@@ -37,31 +37,31 @@ |
||
| 37 | 37 | $response = $deleteRecord->getResponse()->getBody(); |
| 38 | 38 | echo "Deleted Record <br>"; |
| 39 | 39 | print_r($response); |
| 40 | - }else{ |
|
| 40 | + } else{ |
|
| 41 | 41 | echo "Failed to Delete record<br>"; |
| 42 | 42 | echo "Response: ".$response->getStatus()."<br>"; |
| 43 | 43 | print_r($response->getBody()); |
| 44 | 44 | } |
| 45 | - }else{ |
|
| 45 | + } else{ |
|
| 46 | 46 | print_r($updateRecord->getRequest()); |
| 47 | 47 | echo "Failed to Update record<br>"; |
| 48 | 48 | echo "Response: ".$response->getStatus()."<br>"; |
| 49 | 49 | print_r($response->getBody()); |
| 50 | 50 | } |
| 51 | - }else{ |
|
| 51 | + } else{ |
|
| 52 | 52 | echo "Failed to retrieve record<br>"; |
| 53 | 53 | echo "Response: ".$response->getStatus()."<br>"; |
| 54 | 54 | print_r($response->getBody()); |
| 55 | 55 | } |
| 56 | - }else{ |
|
| 56 | + } else{ |
|
| 57 | 57 | echo "Response: ".$response->getStatus(); |
| 58 | 58 | print_r($response->getBody()); |
| 59 | 59 | } |
| 60 | -}catch (\SugarAPI\SDK\Exception\AuthenticationException $ex){ |
|
| 60 | +} catch (\SugarAPI\SDK\Exception\AuthenticationException $ex){ |
|
| 61 | 61 | echo "Auth Options:<pre>"; |
| 62 | 62 | print_r($SugarAPI->getAuthOptions()); |
| 63 | 63 | echo "</pre> Error Message: "; |
| 64 | 64 | print $ex->getMessage(); |
| 65 | -}catch (\SugarAPI\SDK\Exception\SDKException $ex){ |
|
| 65 | +} catch (\SugarAPI\SDK\Exception\SDKException $ex){ |
|
| 66 | 66 | echo $ex->__toString(); |
| 67 | 67 | } |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | if (is_array($data)){ |
| 36 | 36 | if (isset($fileField)){ |
| 37 | 37 | $data[$fileField] = $this->setFileFieldValue($data[$fileField]); |
| 38 | - }else{ |
|
| 38 | + } else{ |
|
| 39 | 39 | foreach ($data as $key => $value){ |
| 40 | 40 | if (strtolower($key)!=='oauth_token' || strtolower($key)!=='delete_if_fails' || strtolower($key)!=='format'){ |
| 41 | 41 | $data[$key] = $this->setFileFieldValue($value); |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | protected function configureData($data){ |
| 23 | 23 | if (is_array($data)){ |
| 24 | 24 | $data['grant_type'] = 'refresh_token'; |
| 25 | - }elseif (is_object($data)){ |
|
| 25 | + } elseif (is_object($data)){ |
|
| 26 | 26 | $data->grant_type = 'refresh_token'; |
| 27 | 27 | } |
| 28 | 28 | return $data; |
@@ -78,9 +78,9 @@ discard block |
||
| 78 | 78 | * Configure the static property $_DEFAULTS with settings from defaults.php |
| 79 | 79 | */ |
| 80 | 80 | protected function loadDefaults(){ |
| 81 | - if (empty(static::$_DEFAULTS)) { |
|
| 81 | + if (empty(static::$_DEFAULTS)){ |
|
| 82 | 82 | include __DIR__ . DIRECTORY_SEPARATOR . 'defaults.php'; |
| 83 | - if (isset($defaults)) { |
|
| 83 | + if (isset($defaults)){ |
|
| 84 | 84 | static::$_DEFAULTS = $defaults; |
| 85 | 85 | } |
| 86 | 86 | } |
@@ -146,12 +146,12 @@ discard block |
||
| 146 | 146 | if ($EntryPoint->authRequired()){ |
| 147 | 147 | if (isset($this->authToken)){ |
| 148 | 148 | $EntryPoint->configureAuth($this->authToken->access_token); |
| 149 | - }else{ |
|
| 149 | + } else{ |
|
| 150 | 150 | throw new AuthenticationException('Authentication is required for EntryPoint ['.$name.'].'); |
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | return $EntryPoint; |
| 154 | - }else{ |
|
| 154 | + } else{ |
|
| 155 | 155 | throw new SDKException('Method '.$name.', is not a registered method of the SugarAPI SDK'); |
| 156 | 156 | } |
| 157 | 157 | } |