@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | public function fetch(int $id): ?Location |
23 | 23 | { |
24 | 24 | /** @var Location|null $fetch */ |
25 | - $fetch = $this->_get('api/locations/location/' . $id); |
|
25 | + $fetch = $this->_get('api/locations/location/'.$id); |
|
26 | 26 | return $fetch; |
27 | 27 | } |
28 | 28 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | public function update(int $id, array $data): ?Location |
50 | 50 | { |
51 | 51 | /** @var Location|null $post */ |
52 | - $post = $this->_post('api/locations/location/' . $id, $data); |
|
52 | + $post = $this->_post('api/locations/location/'.$id, $data); |
|
53 | 53 | return $post; |
54 | 54 | } |
55 | 55 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | public function fetch(int $id): ?DeliveryZone |
23 | 23 | { |
24 | 24 | /** @var DeliveryZone|null $fetch */ |
25 | - $fetch = $this->_get('api/delivery-zones/zone/' . $id); |
|
25 | + $fetch = $this->_get('api/delivery-zones/zone/'.$id); |
|
26 | 26 | return $fetch; |
27 | 27 | } |
28 | 28 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | public function update(int $id, array $data): ?DeliveryZone |
50 | 50 | { |
51 | 51 | /** @var DeliveryZone|null $post */ |
52 | - $post = $this->_post('api/delivery-zones/zone/' . $id, $data); |
|
52 | + $post = $this->_post('api/delivery-zones/zone/'.$id, $data); |
|
53 | 53 | return $post; |
54 | 54 | } |
55 | 55 |
@@ -77,7 +77,7 @@ |
||
77 | 77 | if ($curl->isValid()) { |
78 | 78 | if ($curl->isJSON()) { |
79 | 79 | return ObjectFactory::make($this->getClient(), $curl->getJSON()); |
80 | - } else { |
|
80 | + }else { |
|
81 | 81 | return true; |
82 | 82 | } |
83 | 83 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | public function fetch(int $id): ?Product |
40 | 40 | { |
41 | 41 | /** @var Product|null $fetch */ |
42 | - $fetch = $this->_get('api/products/product/' . $id); |
|
42 | + $fetch = $this->_get('api/products/product/'.$id); |
|
43 | 43 | return $fetch; |
44 | 44 | } |
45 | 45 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | public function update(int $id, array $data): ?Product |
67 | 67 | { |
68 | 68 | /** @var Product|null $post */ |
69 | - $post = $this->_post('api/products/product/' . $id, $data); |
|
69 | + $post = $this->_post('api/products/product/'.$id, $data); |
|
70 | 70 | return $post; |
71 | 71 | } |
72 | 72 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function delete(int $id): bool |
80 | 80 | { |
81 | - return $this->_delete('api/products/product/' . $id); |
|
81 | + return $this->_delete('api/products/product/'.$id); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function setStockLevel(int $id, int $quantity, Location $location): bool |
93 | 93 | { |
94 | - return (bool) $this->_post('api/products/inventory/'. $id . '/quantity', [ |
|
94 | + return (bool) $this->_post('api/products/inventory/'.$id.'/quantity', [ |
|
95 | 95 | 'location' => $location->ID, |
96 | 96 | 'quantity' => $quantity |
97 | 97 | ]); |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | namespace Lifeboat; |
4 | 4 | |
5 | -require_once __DIR__ . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'functions.php'; |
|
5 | +require_once __DIR__.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR.'functions.php'; |
|
6 | 6 | |
7 | 7 | use Lifeboat\Exceptions\BadMethodException; |
8 | 8 | use Lifeboat\Exceptions\OAuthException; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | |
113 | 113 | if (!$response->isValid() || !$json || !array_key_exists('access_token', $json)) { |
114 | 114 | throw new OAuthException($response->getError()); |
115 | - } else { |
|
115 | + }else { |
|
116 | 116 | $this->setAccessToken($json['access_token']); |
117 | 117 | } |
118 | 118 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | public function curl_api(string $url, string $method = 'GET', array $data = [], array $headers = []): CurlResponse |
189 | 189 | { |
190 | 190 | $url = URL::is_absolute_url($url) ? $url |
191 | - : 'https://' . rtrim($this->getHost(), '/') . '/' . ltrim($url, '/'); |
|
191 | + : 'https://'.rtrim($this->getHost(), '/').'/'.ltrim($url, '/'); |
|
192 | 192 | |
193 | 193 | $curl = new Curl($url, $data, $headers); |
194 | 194 | |
@@ -207,6 +207,6 @@ discard block |
||
207 | 207 | */ |
208 | 208 | protected function auth_url(string $path): string |
209 | 209 | { |
210 | - return rtrim($this->_auth_domain, '/') . '/' . ltrim($path, '/'); |
|
210 | + return rtrim($this->_auth_domain, '/').'/'.ltrim($path, '/'); |
|
211 | 211 | } |
212 | 212 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | */ |
14 | 14 | class App extends Connector { |
15 | 15 | |
16 | - const CODE_URL = '/oauth/code'; |
|
16 | + const CODE_URL = '/oauth/code'; |
|
17 | 17 | |
18 | 18 | const ACCESS_TOKEN_PARAM = 'lb_app_access_token'; |
19 | 19 | const API_CHALLENGE_PARAM = 'lb_app_api_challenge'; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | public function __construct(string $app_id, string $app_secret, string $auth_domain = self::AUTH_DOMAIN) |
31 | 31 | { |
32 | 32 | if (!$app_id || !$app_secret) { |
33 | - throw new InvalidArgumentException(static::class . "expects an app_id and app_secret"); |
|
33 | + throw new InvalidArgumentException(static::class."expects an app_id and app_secret"); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | $this->setAppID($app_id); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | if (!$response->isValid() || !$json || !array_key_exists('access_token', $json)) { |
162 | 162 | return ''; |
163 | - } else { |
|
163 | + }else { |
|
164 | 164 | $this->setAccessToken($json['access_token']); |
165 | 165 | return $this->getAccessToken(false); |
166 | 166 | } |