@@ -27,7 +27,7 @@ |
||
| 27 | 27 | [ |
| 28 | 28 | 'name' => 'file_names', |
| 29 | 29 | 'contents' => isset($params['file_names']) ? $params['file_names'] : null |
| 30 | - ],[ |
|
| 30 | + ], [ |
|
| 31 | 31 | 'name' => 'folder_paths', |
| 32 | 32 | 'contents' => isset($params['folder_paths']) ? $params['folder_paths'] : null |
| 33 | 33 | ] |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | $options["headers"]["User-Agent"] = $this->user_agent; |
| 71 | 71 | |
| 72 | 72 | if ($this->oauth2) { |
| 73 | - $options["headers"]["Authorization"] = "Bearer " . $this->key; |
|
| 73 | + $options["headers"]["Authorization"] = "Bearer ".$this->key; |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | try { |
@@ -147,7 +147,7 @@ |
||
| 147 | 147 | { |
| 148 | 148 | $endpoint = 'https://api.hubapi.com/companies/v2/groups/'; |
| 149 | 149 | |
| 150 | - if($includeProperties){ |
|
| 150 | + if ($includeProperties) { |
|
| 151 | 151 | $queryString = build_query_string(['includeProperties' => 'true']); |
| 152 | 152 | |
| 153 | 153 | return $this->client->request('get', $endpoint, [], $queryString); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (! function_exists('build_query_string')) { |
|
| 3 | +if (!function_exists('build_query_string')) { |
|
| 4 | 4 | /** |
| 5 | 5 | * Generate a query string. |
| 6 | 6 | * |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | if (is_array($value)) { |
| 20 | 20 | $query .= build_batch_query_string($key, $value, $encoding); |
| 21 | 21 | } elseif (!empty($value)) { |
| 22 | - $query .= '&' . url_encode($key, $encoding) . '=' . url_encode($value, $encoding); |
|
| 22 | + $query .= '&'.url_encode($key, $encoding).'='.url_encode($value, $encoding); |
|
| 23 | 23 | } |
| 24 | 24 | } |
| 25 | 25 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | -if (! function_exists('build_batch_query_string')) { |
|
| 30 | +if (!function_exists('build_batch_query_string')) { |
|
| 31 | 31 | /** |
| 32 | 32 | * Generate a query string for batch requests. |
| 33 | 33 | * |
@@ -38,13 +38,13 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | function build_batch_query_string($key, $items, $encoding = PHP_QUERY_RFC3986) |
| 40 | 40 | { |
| 41 | - return array_reduce($items, function ($query, $item) use ($key, $encoding) { |
|
| 42 | - return $query . "&" . url_encode($key, $encoding) . '=' . url_encode($item, $encoding); |
|
| 41 | + return array_reduce($items, function($query, $item) use ($key, $encoding) { |
|
| 42 | + return $query."&".url_encode($key, $encoding).'='.url_encode($item, $encoding); |
|
| 43 | 43 | }, ''); |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | -if (! function_exists('url_encode')) { |
|
| 47 | +if (!function_exists('url_encode')) { |
|
| 48 | 48 | /** |
| 49 | 49 | * Url encode a string. |
| 50 | 50 | * |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | -if (! function_exists('ms_timestamp')) { |
|
| 70 | +if (!function_exists('ms_timestamp')) { |
|
| 71 | 71 | /** |
| 72 | 72 | * Get a millisecond timestamp from a date or time. |
| 73 | 73 | * |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * @return \Psr\Http\Message\ResponseInterface|\SevenShores\Hubspot\Http\Response |
| 40 | 40 | * @throws \SevenShores\Hubspot\Exceptions\BadRequest |
| 41 | 41 | */ |
| 42 | - function getAll(array $params = []){ |
|
| 42 | + function getAll(array $params = []) { |
|
| 43 | 43 | $endpoint = "https://api.hubapi.com/deals/v1/deal/paged"; |
| 44 | 44 | |
| 45 | 45 | $queryString = build_query_string($params); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | { |
| 104 | 104 | $endpoint = "https://api.hubapi.com/deals/v1/deal/{$dealId}/associations/COMPANY"; |
| 105 | 105 | |
| 106 | - $queryString = build_query_string(['id' => (array)$companyIds]); |
|
| 106 | + $queryString = build_query_string(['id' => (array) $companyIds]); |
|
| 107 | 107 | |
| 108 | 108 | return $this->client->request('put', $endpoint, [], $queryString); |
| 109 | 109 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | $endpoint = "https://api.hubapi.com/deals/v1/deal/{$dealId}/associations/COMPANY"; |
| 119 | 119 | |
| 120 | - $queryString = build_query_string(['id' => (array)$companyIds]); |
|
| 120 | + $queryString = build_query_string(['id' => (array) $companyIds]); |
|
| 121 | 121 | |
| 122 | 122 | return $this->client->request('delete', $endpoint, [], $queryString); |
| 123 | 123 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | { |
| 132 | 132 | $endpoint = "https://api.hubapi.com/deals/v1/deal/{$dealId}/associations/CONTACT"; |
| 133 | 133 | |
| 134 | - $queryString = build_query_string(['id' => (array)$contactIds]); |
|
| 134 | + $queryString = build_query_string(['id' => (array) $contactIds]); |
|
| 135 | 135 | |
| 136 | 136 | return $this->client->request('put', $endpoint, [], $queryString); |
| 137 | 137 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | { |
| 157 | 157 | $endpoint = "https://api.hubapi.com/deals/v1/deal/{$dealId}/associations/CONTACT"; |
| 158 | 158 | |
| 159 | - $queryString = build_query_string(['id' => (array)$contactIds]); |
|
| 159 | + $queryString = build_query_string(['id' => (array) $contactIds]); |
|
| 160 | 160 | |
| 161 | 161 | return $this->client->request('delete', $endpoint, [], $queryString); |
| 162 | 162 | } |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | * |
| 58 | 58 | * @see https://developers.hubspot.com/docs/methods/timeline/batch-create-or-update-events |
| 59 | 59 | */ |
| 60 | - public function createOrUpdateBatch($appId,$events=[]) |
|
| 60 | + public function createOrUpdateBatch($appId, $events = []) |
|
| 61 | 61 | { |
| 62 | 62 | $endpoint = "https://api.hubapi.com/integrations/v1/{$appId}/timeline/event/batch"; |
| 63 | 63 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public function delete($name) |
| 75 | 75 | { |
| 76 | - $endpoint = 'https://api.hubapi.com/properties/v1/deals/properties/named/' . $name; |
|
| 76 | + $endpoint = 'https://api.hubapi.com/properties/v1/deals/properties/named/'.$name; |
|
| 77 | 77 | return $this->client->request('delete', $endpoint); |
| 78 | 78 | } |
| 79 | 79 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | { |
| 154 | 154 | $endpoint = "https://api.hubapi.com/properties/v1/deals/groups/named/{$groupName}"; |
| 155 | 155 | |
| 156 | - if($includeProperties){ |
|
| 156 | + if ($includeProperties) { |
|
| 157 | 157 | $queryString = build_query_string(['includeProperties' => 'true']); |
| 158 | 158 | |
| 159 | 159 | return $this->client->request('get', $endpoint, [], $queryString); |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | { |
| 175 | 175 | $endpoint = 'https://api.hubapi.com/properties/v1/deals/groups'; |
| 176 | 176 | |
| 177 | - if($includeProperties){ |
|
| 177 | + if ($includeProperties) { |
|
| 178 | 178 | $queryString = build_query_string(['includeProperties' => 'true']); |
| 179 | 179 | |
| 180 | 180 | return $this->client->request('get', $endpoint, [], $queryString); |
@@ -14,15 +14,15 @@ |
||
| 14 | 14 | * @param array $scopesArray A set of scopes that your app will need access to. |
| 15 | 15 | * @return \SevenShores\Hubspot\Http\Response |
| 16 | 16 | */ |
| 17 | - function getAuthUrl($clientId, $redirectURI, $scopesArray=array()) |
|
| 17 | + function getAuthUrl($clientId, $redirectURI, $scopesArray = array()) |
|
| 18 | 18 | { |
| 19 | 19 | $scopeString = ''; |
| 20 | - if(count($scopesArray)>0) |
|
| 20 | + if (count($scopesArray) > 0) |
|
| 21 | 21 | { |
| 22 | 22 | $scopeString = ''; |
| 23 | - foreach($scopesArray as $_index => $scopeStr) |
|
| 23 | + foreach ($scopesArray as $_index => $scopeStr) |
|
| 24 | 24 | { |
| 25 | - if($_index>0) |
|
| 25 | + if ($_index > 0) |
|
| 26 | 26 | $scopeString .= "%20"; |
| 27 | 27 | |
| 28 | 28 | $scopeString .= $scopeStr; |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | public function createTable($name, array $columns, $published = true, $useForPages = false) { |
| 74 | 74 | $endpoint = 'https://api.hubapi.com/hubdb/api/v1/tables'; |
| 75 | 75 | $options['json'] = ['name' => $name, 'columns' => $columns]; |
| 76 | - if($published) { |
|
| 76 | + if ($published) { |
|
| 77 | 77 | $options['json']['publishedAt'] = round(microtime(true) * 1000); |
| 78 | 78 | } |
| 79 | 79 | $options['json']['useForPages'] = $useForPages; |