@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $this->token->refresh($this); |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | - return 'Basic ' . base64_encode($this->token->getUsername() . ':' . $this->token->getPassword()); |
|
| 172 | + return 'Basic '.base64_encode($this->token->getUsername().':'.$this->token->getPassword()); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | /** |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | */ |
| 203 | 203 | public function buildUri($resource) |
| 204 | 204 | { |
| 205 | - $uri = $this->getUrl() . ltrim($resource, '/'); |
|
| 205 | + $uri = $this->getUrl().ltrim($resource, '/'); |
|
| 206 | 206 | |
| 207 | 207 | if (strlen($uri) > 2000) { |
| 208 | 208 | throw new MalformedRequest( |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | return array_merge( |
| 262 | 262 | [ |
| 263 | 263 | 'x-cw-usertype' => 'member', |
| 264 | - 'Accept' => 'application/vnd.connectwise.com+json; version=' . $this->version, |
|
| 264 | + 'Accept' => 'application/vnd.connectwise.com+json; version='.$this->version, |
|
| 265 | 265 | ], |
| 266 | 266 | $authorization_headers, |
| 267 | 267 | $this->headers |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | */ |
| 296 | 296 | public function getUrl() |
| 297 | 297 | { |
| 298 | - return $this->url . '/v4_6_release/apis/3.0/'; |
|
| 298 | + return $this->url.'/v4_6_release/apis/3.0/'; |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | /** |
@@ -324,14 +324,14 @@ discard block |
||
| 324 | 324 | */ |
| 325 | 325 | protected function processResponse($resource, Response $response) |
| 326 | 326 | { |
| 327 | - $response = (array)json_decode($response->getBody(), true); |
|
| 327 | + $response = (array) json_decode($response->getBody(), true); |
|
| 328 | 328 | |
| 329 | 329 | if ($model = $this->resolver->find($resource, $this->version)) { |
| 330 | - $model = 'Spinen\ConnectWise\Models\\' . $model; |
|
| 330 | + $model = 'Spinen\ConnectWise\Models\\'.$model; |
|
| 331 | 331 | |
| 332 | 332 | if ($this->isCollection($response)) { |
| 333 | 333 | $response = array_map( |
| 334 | - function ($item) use ($model) { |
|
| 334 | + function($item) use ($model) { |
|
| 335 | 335 | $item = new $model($item, $this); |
| 336 | 336 | |
| 337 | 337 | return $item; |
@@ -83,10 +83,10 @@ |
||
| 83 | 83 | $app->make(Token::class), $app->make(Guzzle::class), |
| 84 | 84 | $app->make(ModelResolver::class) |
| 85 | 85 | ))->setClientId($app->config->get('services.connectwise.client_id')) |
| 86 | - ->setIntegrator($app->config->get('services.connectwise.integrator')) |
|
| 87 | - ->setPassword($app->config->get('services.connectwise.password')) |
|
| 88 | - ->setUrl($app->config->get('services.connectwise.url')) |
|
| 89 | - ->setVersion($app->config->get('services.connectwise.version')); |
|
| 86 | + ->setIntegrator($app->config->get('services.connectwise.integrator')) |
|
| 87 | + ->setPassword($app->config->get('services.connectwise.password')) |
|
| 88 | + ->setUrl($app->config->get('services.connectwise.url')) |
|
| 89 | + ->setVersion($app->config->get('services.connectwise.version')); |
|
| 90 | 90 | } |
| 91 | 91 | ); |
| 92 | 92 | } |