Completed
Push — master ( cd617c...28284d )
by Ryan
01:42
created
src/Resources/Deals.php 3 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace SevenShores\Hubspot\Resources;
3 3
 
4
-use SevenShores\Hubspot\Exceptions\HubspotException;
5
-
6 4
 class Deals extends Resource
7 5
 {
8 6
     /**
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
Doc Comments   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 {
8 8
     /**
9 9
      * @param array $deal Array of deal properties.
10
-     * @return mixed
10
+     * @return \Psr\Http\Message\ResponseInterface
11 11
      * @throws HubSpotException
12 12
      */
13 13
     function create(array $deal)
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     /**
23 23
      * @param int $id The deal id.
24 24
      * @param array $deal The deal properties to update.
25
-     * @return mixed
25
+     * @return \Psr\Http\Message\ResponseInterface
26 26
      */
27 27
     function update($id, array $deal)
28 28
     {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
     /**
52 52
      * @param int $id
53
-     * @return mixed
53
+     * @return \Psr\Http\Message\ResponseInterface
54 54
      */
55 55
     function delete($id)
56 56
     {
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
     /**
63 63
      * @param array $params Optional parameters ['limit', 'offset']
64
-     * @return mixed
64
+     * @return \Psr\Http\Message\ResponseInterface
65 65
      */
66 66
     function getRecentlyModified(array $params = [])
67 67
     {
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
     /**
75 75
      * @param array $params Optional parameters ['limit', 'offset']
76
-     * @return mixed
76
+     * @return \Psr\Http\Message\ResponseInterface
77 77
      */
78 78
     function getRecentlyCreated(array $params = [])
79 79
     {
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
     /**
87 87
      * @param int $id
88
-     * @return mixed
88
+     * @return \Psr\Http\Message\ResponseInterface
89 89
      */
90 90
     function getById($id)
91 91
     {
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     /**
98 98
      * @param int $dealId
99 99
      * @param int|int[] $companyIds
100
-     * @return mixed
100
+     * @return \Psr\Http\Message\ResponseInterface
101 101
      */
102 102
     function associateWithCompany($dealId, $companyIds)
103 103
     {
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     /**
112 112
      * @param int $dealId
113 113
      * @param int|int[] $companyIds
114
-     * @return mixed
114
+     * @return \Psr\Http\Message\ResponseInterface
115 115
      */
116 116
     function disassociateFromCompany($dealId, $companyIds)
117 117
     {
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     /**
126 126
      * @param int $dealId
127 127
      * @param int|int[] $contactIds
128
-     * @return mixed
128
+     * @return \Psr\Http\Message\ResponseInterface
129 129
      */
130 130
     function associateWithContact($dealId, $contactIds)
131 131
     {
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
     /**
140 140
      * @param int $contactId
141 141
      * @param array $params Optional parameters ['limit', 'offset']
142
-     * @return mixed
142
+     * @return \Psr\Http\Message\ResponseInterface
143 143
      */
144 144
     function associatedWithContact($contactId, $params = [])
145 145
     {
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     /**
154 154
      * @param int $dealId
155 155
      * @param int|int[] $contactIds
156
-     * @return mixed
156
+     * @return \Psr\Http\Message\ResponseInterface
157 157
      */
158 158
     function disassociateFromContact($dealId, $contactIds)
159 159
     {
Please login to merge, or discard this patch.
src/Resources/Files.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
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
             ]
Please login to merge, or discard this patch.
src/Resources/SingleEmail.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@
 block discarded – undo
20 20
         $endpoint = "https://api.hubapi.com/email/public/v1/singleEmail/send";
21 21
 
22 22
         $options['json'] = [
23
-          'emailId'           => $id,
24
-          'message'           => $message,
25
-          'contactProperties' => $contactProperties,
26
-          'customProperties'  => $customProperties
23
+            'emailId'           => $id,
24
+            'message'           => $message,
25
+            'contactProperties' => $contactProperties,
26
+            'customProperties'  => $customProperties
27 27
         ];
28 28
 
29 29
         return $this->client->request('post', $endpoint, $options);
Please login to merge, or discard this patch.
src/Http/Client.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
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 {
Please login to merge, or discard this patch.
src/Resources/CompanyProperties.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/helpers.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
      *
Please login to merge, or discard this patch.
src/Resources/Events.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@
 block discarded – undo
32 32
         $required['email'] = $contactEmail;
33 33
 
34 34
         $parameters = array_merge(
35
-          $required,
36
-          ['_m' => $contactRevenue],
37
-          $contactProperties
35
+            $required,
36
+            ['_m' => $contactRevenue],
37
+            $contactProperties
38 38
         );
39 39
 
40 40
         $query_string = build_query_string($parameters);
Please login to merge, or discard this patch.
src/Resources/Timeline.php 2 patches
Doc Comments   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
      * @param mixed       $timestamp
18 18
      * @param array       $eventTypeData
19 19
      *
20
-     * @return mixed
20
+     * @return \Psr\Http\Message\ResponseInterface
21 21
      *
22 22
      * @see http://developers.hubspot.com/docs/methods/timeline/create-or-update-event
23 23
      */
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      * @param  int      $appId
54 54
      * @param  array    $events
55 55
      *
56
-     * @return mixed
56
+     * @return \Psr\Http\Message\ResponseInterface
57 57
      *
58 58
      * @see https://developers.hubspot.com/docs/methods/timeline/batch-create-or-update-events
59 59
      */
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
      *
72 72
      * @param int $appId
73 73
      *
74
-     * @return mixed
74
+     * @return \Psr\Http\Message\ResponseInterface
75 75
      *
76 76
      * @see http://developers.hubspot.com/docs/methods/timeline/get-event-types
77 77
      */
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      * @param string|null $detailTemplate
91 91
      * @param string|null $objectType
92 92
      *
93
-     * @return mixed
93
+     * @return \Psr\Http\Message\ResponseInterface
94 94
      *
95 95
      * @see http://developers.hubspot.com/docs/methods/timeline/create-event-type
96 96
      */
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
      * @param string|null $detailTemplate
125 125
      * @param string|null $objectType
126 126
      *
127
-     * @return mixed
127
+     * @return \Psr\Http\Message\ResponseInterface
128 128
      *
129 129
      * @see http://developers.hubspot.com/docs/methods/timeline/update-event-type
130 130
      */
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
      * @param int $appId
156 156
      * @param int $eventTypeId
157 157
      *
158
-     * @return mixed
158
+     * @return \Psr\Http\Message\ResponseInterface
159 159
      *
160 160
      * @see http://developers.hubspot.com/docs/methods/timeline/delete-event-type
161 161
      */
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
      * @param int $appId
172 172
      * @param int $eventTypeId
173 173
      *
174
-     * @return mixed
174
+     * @return \Psr\Http\Message\ResponseInterface
175 175
      *
176 176
      * @see http://developers.hubspot.com/docs/methods/timeline/get-timeline-event-type-properties
177 177
      */
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
      * @param string|null $objectProperty
193 193
      * @param array       $options
194 194
      *
195
-     * @return mixed
195
+     * @return \Psr\Http\Message\ResponseInterface
196 196
      *
197 197
      * @see http://developers.hubspot.com/docs/methods/timeline/create-timeline-event-type-property
198 198
      */
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
      * @param string     $propertyType
230 230
      * @param array|null $options
231 231
      *
232
-     * @return mixed
232
+     * @return \Psr\Http\Message\ResponseInterface
233 233
      *
234 234
      * @see http://developers.hubspot.com/docs/methods/timeline/udpate-timeline-event-type-property
235 235
      */
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
      * @param int $eventTypeId
266 266
      * @param int $eventTypePropertyId
267 267
      *
268
-     * @return mixed
268
+     * @return \Psr\Http\Message\ResponseInterface
269 269
      *
270 270
      * @see http://developers.hubspot.com/docs/methods/timeline/delete-timeline-event-type-property
271 271
      */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Resources/DealProperties.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.