| @@ -9,7 +9,7 @@ | ||
| 9 | 9 |  { | 
| 10 | 10 | public function register() | 
| 11 | 11 |      { | 
| 12 | -        $this->app->singleton('salesforce', function () { | |
| 12 | +        $this->app->singleton('salesforce', function() { | |
| 13 | 13 | $authClient = new Client([ | 
| 14 | 14 | 'headers' => [ | 
| 15 | 15 | 'Accept' => 'application/json', | 
| @@ -42,7 +42,7 @@ | ||
| 42 | 42 | /** | 
| 43 | 43 | * SalesforceAuth constructor. | 
| 44 | 44 | * | 
| 45 | - * @param $client | |
| 45 | + * @param \GuzzleHttp\Client $client | |
| 46 | 46 | */ | 
| 47 | 47 | public function __construct($client) | 
| 48 | 48 |      { | 
| @@ -83,7 +83,7 @@ | ||
| 83 | 83 | $this->id = $responseObject->id; | 
| 84 | 84 | $this->accessToken = $responseObject->access_token; | 
| 85 | 85 | $this->instanceUrl = $responseObject->instance_url; | 
| 86 | - $this->url = $responseObject->instance_url . $this->version['url']; | |
| 86 | + $this->url = $responseObject->instance_url.$this->version['url']; | |
| 87 | 87 | |
| 88 | 88 |          if ($this->accessToken !== null) { | 
| 89 | 89 | $this->authenticated = true; | 
| @@ -113,7 +113,7 @@ discard block | ||
| 113 | 113 |      { | 
| 114 | 114 | return $this->sendRequest( | 
| 115 | 115 | 'GET', | 
| 116 | - '/analytics/reports/' . $id, | |
| 116 | + '/analytics/reports/'.$id, | |
| 117 | 117 | ['query' => ['includeDetails' => $includeDetails]] | 
| 118 | 118 | ); | 
| 119 | 119 | } | 
| @@ -146,7 +146,7 @@ discard block | ||
| 146 | 146 | return false; | 
| 147 | 147 | } | 
| 148 | 148 | |
| 149 | -        $response = $this->sendRequest('GET', "/sobjects/" . $this->getType() . "/$id", ['query' => $fields]); | |
| 149 | +        $response = $this->sendRequest('GET', "/sobjects/".$this->getType()."/$id", ['query' => $fields]); | |
| 150 | 150 | |
| 151 | 151 |          if (!$response) { | 
| 152 | 152 | return false; | 
| @@ -198,7 +198,7 @@ discard block | ||
| 198 | 198 | */ | 
| 199 | 199 | public function create(array $params) | 
| 200 | 200 |      { | 
| 201 | -        $response = $this->sendRequest('POST', "/sobject/" . $this->getType(), [ | |
| 201 | +        $response = $this->sendRequest('POST', "/sobject/".$this->getType(), [ | |
| 202 | 202 | 'json' => $params, | 
| 203 | 203 | ]); | 
| 204 | 204 | |
| @@ -222,7 +222,7 @@ discard block | ||
| 222 | 222 | */ | 
| 223 | 223 | public function delete(string $id) | 
| 224 | 224 |      { | 
| 225 | -        $response = $this->sendRequest('DELETE', "/sobjects/" . $this->getType() ."/$id"); | |
| 225 | +        $response = $this->sendRequest('DELETE', "/sobjects/".$this->getType()."/$id"); | |
| 226 | 226 | |
| 227 | 227 |          if (!$response) { | 
| 228 | 228 | return false; | 
| @@ -3,7 +3,6 @@ | ||
| 3 | 3 | namespace Surge\LaravelSalesforce\Objects; | 
| 4 | 4 | |
| 5 | 5 | use Event; | 
| 6 | -use GuzzleHttp\ClientInterface; | |
| 7 | 6 | use Surge\LaravelSalesforce\Events\RequestSent; | 
| 8 | 7 | use Surge\LaravelSalesforce\Events\ResponseReceived; | 
| 9 | 8 | use Surge\LaravelSalesforce\Exceptions\SalesforceException; | 
| @@ -128,7 +128,7 @@ | ||
| 128 | 128 | /** | 
| 129 | 129 | * Run Salesforce query. | 
| 130 | 130 | * | 
| 131 | - * @param $query | |
| 131 | + * @param string $query | |
| 132 | 132 | * | 
| 133 | 133 | * @return mixed | 
| 134 | 134 | */ | 
| @@ -64,7 +64,7 @@ discard block | ||
| 64 | 64 | /** | 
| 65 | 65 | * Create object dynamically | 
| 66 | 66 | * | 
| 67 | - * @param $method | |
| 67 | + * @param string $method | |
| 68 | 68 | * @param $args | 
| 69 | 69 | * @return bool | 
| 70 | 70 | */ | 
| @@ -80,6 +80,9 @@ discard block | ||
| 80 | 80 | return (new BaseObject($this, $type))->create($args[0]); | 
| 81 | 81 | } | 
| 82 | 82 | |
| 83 | + /** | |
| 84 | + * @param string $method | |
| 85 | + */ | |
| 83 | 86 | private function callUpdateOnObject($method, $args) | 
| 84 | 87 |      { | 
| 85 | 88 | $type = substr($method, 6); | 
| @@ -92,6 +95,9 @@ discard block | ||
| 92 | 95 | return (new BaseObject($this, $type))->update($type, $args[0]); | 
| 93 | 96 | } | 
| 94 | 97 | |
| 98 | + /** | |
| 99 | + * @param string $method | |
| 100 | + */ | |
| 95 | 101 | private function callDeleteOnObject($method, $args) | 
| 96 | 102 |      { | 
| 97 | 103 | $type = substr($method, 6); | 
| @@ -104,6 +110,9 @@ discard block | ||
| 104 | 110 | return (new BaseObject($this, $type))->delete($type, $args[0]); | 
| 105 | 111 | } | 
| 106 | 112 | |
| 113 | + /** | |
| 114 | + * @param string $method | |
| 115 | + */ | |
| 107 | 116 | private function callGetOnObject($method, $args) | 
| 108 | 117 |      { | 
| 109 | 118 | $type = substr($method, 3); | 
| @@ -2,7 +2,6 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace Surge\LaravelSalesforce; | 
| 4 | 4 | |
| 5 | -use Event; | |
| 6 | 5 | use GuzzleHttp\ClientInterface; | 
| 7 | 6 | use Surge\LaravelSalesforce\Objects\BaseObject; | 
| 8 | 7 | |
| @@ -71,7 +71,7 @@ discard block | ||
| 71 | 71 | private function callCreateOnObject($method, $args) | 
| 72 | 72 |      { | 
| 73 | 73 | $type = substr($method, 6); | 
| 74 | - $class = '\\Surge\\LaravelSalesforce\\Objects\\' . $type; | |
| 74 | + $class = '\\Surge\\LaravelSalesforce\\Objects\\'.$type; | |
| 75 | 75 | |
| 76 | 76 |          if (class_exists($class)) { | 
| 77 | 77 | return (new $class($this))->create($args[0]); | 
| @@ -83,7 +83,7 @@ discard block | ||
| 83 | 83 | private function callUpdateOnObject($method, $args) | 
| 84 | 84 |      { | 
| 85 | 85 | $type = substr($method, 6); | 
| 86 | - $class = '\\Surge\\LaravelSalesforce\\Objects\\' . $type; | |
| 86 | + $class = '\\Surge\\LaravelSalesforce\\Objects\\'.$type; | |
| 87 | 87 | |
| 88 | 88 |          if (class_exists($class)) { | 
| 89 | 89 | return (new $class($this))->update($args[0]); | 
| @@ -95,7 +95,7 @@ discard block | ||
| 95 | 95 | private function callDeleteOnObject($method, $args) | 
| 96 | 96 |      { | 
| 97 | 97 | $type = substr($method, 6); | 
| 98 | - $class = '\\Surge\\LaravelSalesforce\\Objects\\' . $type; | |
| 98 | + $class = '\\Surge\\LaravelSalesforce\\Objects\\'.$type; | |
| 99 | 99 | |
| 100 | 100 |          if (class_exists($class)) { | 
| 101 | 101 | return (new $class($this))->delete($args[0]); | 
| @@ -107,7 +107,7 @@ discard block | ||
| 107 | 107 | private function callGetOnObject($method, $args) | 
| 108 | 108 |      { | 
| 109 | 109 | $type = substr($method, 3); | 
| 110 | - $class = '\\Surge\\LaravelSalesforce\\Objects\\' . $type; | |
| 110 | + $class = '\\Surge\\LaravelSalesforce\\Objects\\'.$type; | |
| 111 | 111 | |
| 112 | 112 |          if (class_exists($class)) { | 
| 113 | 113 | return (new $class($this))->get($args[0]); |