Passed
Push — develop ( 2938d4...0e22ee )
by Benjamin
08:51
created
src/widgets/Report.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@
 block discarded – undo
143 143
 
144 144
             return $view->renderTemplate('analytics/_components/widgets/Report/body');
145 145
         } catch (\Exception $exception) {
146
-            Craft::error('Couldn’t load report widget: '.$exception->getMessage(). " ".$exception->getTraceAsString(), __METHOD__);
146
+            Craft::error('Couldn’t load report widget: '.$exception->getMessage()." ".$exception->getTraceAsString(), __METHOD__);
147 147
             return $view->renderTemplate('analytics/_special/error');
148 148
         }
149 149
     }
Please login to merge, or discard this patch.
src/controllers/ReportsController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
         try {
38 38
             $response = Analytics::$plugin->getReports()->getEcommerceReport($viewId, $period);
39
-        } catch(\Google_Service_Exception $googleServiceException) {
39
+        } catch (\Google_Service_Exception $googleServiceException) {
40 40
             return $this->handleGoogleServiceException($googleServiceException);
41 41
         }
42 42
 
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
     public function actionElement()
55 55
     {
56 56
         $elementId = Craft::$app->getRequest()->getRequiredParam('elementId');
57
-        $siteId = (int)Craft::$app->getRequest()->getRequiredParam('siteId');
57
+        $siteId = (int) Craft::$app->getRequest()->getRequiredParam('siteId');
58 58
         $metric = Craft::$app->getRequest()->getRequiredParam('metric');
59 59
 
60 60
         try {
61 61
             $response = Analytics::$plugin->getReports()->getElementReport($elementId, $siteId, $metric);
62
-        } catch(\Google_Service_Exception $googleServiceException) {
62
+        } catch (\Google_Service_Exception $googleServiceException) {
63 63
             return $this->handleGoogleServiceException($googleServiceException);
64 64
         }
65 65
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
         try {
99 99
             $response = Analytics::$plugin->getReports()->getRealtimeReport($request);
100
-        } catch(\Google_Service_Exception $googleServiceException) {
100
+        } catch (\Google_Service_Exception $googleServiceException) {
101 101
             return $this->handleGoogleServiceException($googleServiceException);
102 102
         }
103 103
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
 
191 191
             return $this->asJson($response);
192
-        } catch(\Google_Service_Exception $googleServiceException) {
192
+        } catch (\Google_Service_Exception $googleServiceException) {
193 193
             return $this->handleGoogleServiceException($googleServiceException);
194 194
         }
195 195
     }
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
     {
209 209
         $errors = $e->getErrors();
210 210
 
211
-        if(empty($errors)) {
211
+        if (empty($errors)) {
212 212
             throw $e;
213 213
         }
214 214
 
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 
349 349
         $totalRevenue = 0;
350 350
 
351
-        foreach($rows as $row) {
351
+        foreach ($rows as $row) {
352 352
             $totalRevenue += $row[1];
353 353
         }
354 354
 
Please login to merge, or discard this patch.
src/services/Reports.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
             Analytics::$plugin->getCache()->set($cacheId, $response, $cacheDuration);
52 52
         }
53 53
 
54
-        return (array)$response;
54
+        return (array) $response;
55 55
     }
56 56
 
57 57
     /**
Please login to merge, or discard this patch.
src/services/Analytics.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 
207 207
         return $gclid;
208 208
     }
209
-     /* -- _getGclid */
209
+        /* -- _getGclid */
210 210
 
211 211
     /**
212 212
      * _gaParseCookie handles the parsing of the _ga cookie or setting it to a unique identifier
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 
230 230
         return $cid;
231 231
     }
232
-     /* -- _gaParseCookie */
232
+        /* -- _gaParseCookie */
233 233
 
234 234
     /**
235 235
      * _gaGenUUID Generate UUID v4 function - needed to generate a CID when one isn't available
@@ -254,5 +254,5 @@  discard block
 block discarded – undo
254 254
             random_int(0, 0xffff), random_int(0, 0xffff), random_int(0, 0xffff)
255 255
         );
256 256
     }
257
-     /* -- _gaGenUUID */
257
+        /* -- _gaGenUUID */
258 258
 }
Please login to merge, or discard this patch.
src/models/ReportRequestCriteria.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
             $response['report'] = Analytics::$plugin->getApis()->getAnalyticsReporting()->getReport($this, $toArray);
113 113
             $response['success'] = true;
114 114
         }
115
-        catch(\Exception $exception)
115
+        catch (\Exception $exception)
116 116
         {
117 117
             $response['error'] = true;
118 118
             $response['errorMessage'] = $exception->getMessage();
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -111,8 +111,7 @@
 block discarded – undo
111 111
         {
112 112
             $response['report'] = Analytics::$plugin->getApis()->getAnalyticsReporting()->getReport($this, $toArray);
113 113
             $response['success'] = true;
114
-        }
115
-        catch(\Exception $exception)
114
+        } catch(\Exception $exception)
116 115
         {
117 116
             $response['error'] = true;
118 117
             $response['errorMessage'] = $exception->getMessage();
Please login to merge, or discard this patch.
src/apis/Analytics.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         $items[] = $response->toSimpleObject()->items;
138 138
         $index += is_array($response->toSimpleObject()->items) || $response->toSimpleObject()->items instanceof \Countable ? count($response->toSimpleObject()->items) : 0;
139 139
 
140
-        while($index < $totalResults) {
140
+        while ($index < $totalResults) {
141 141
             $startIndex = $index + 1;
142 142
 
143 143
             $response = $managementAccounts->listManagementAccounts([
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
         $items[] = $response->toSimpleObject()->items;
180 180
         $index += is_array($response->toSimpleObject()->items) || $response->toSimpleObject()->items instanceof \Countable ? count($response->toSimpleObject()->items) : 0;
181 181
 
182
-        while($index < $totalResults) {
182
+        while ($index < $totalResults) {
183 183
             $startIndex = $index + 1;
184 184
 
185 185
             $response = $managementWebProperties->listManagementWebproperties('~all', [
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
         $items[] = $response->toSimpleObject()->items;
222 222
         $index += is_array($response->toSimpleObject()->items) || $response->toSimpleObject()->items instanceof \Countable ? count($response->toSimpleObject()->items) : 0;
223 223
 
224
-        while($index < $totalResults) {
224
+        while ($index < $totalResults) {
225 225
             $startIndex = $index + 1;
226 226
 
227 227
             $response = $managementWebProfiles->listManagementProfiles('~all', '~all', [
@@ -345,11 +345,11 @@  discard block
 block discarded – undo
345 345
             case 'float':
346 346
             case 'time':
347 347
             case 'percent':
348
-                return (float)$value;
348
+                return (float) $value;
349 349
                 break;
350 350
 
351 351
             default:
352
-                return (string)$value;
352
+                return (string) $value;
353 353
         }
354 354
     }
355 355
 }
Please login to merge, or discard this patch.