@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | try { |
| 38 | 38 | $response = Analytics::$plugin->getReports()->getEcommerceReport($viewId, $period); |
| 39 | - } catch(\Google_Service_Exception $e) { |
|
| 39 | + } catch (\Google_Service_Exception $e) { |
|
| 40 | 40 | return $this->handleGoogleServiceException($e); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -54,12 +54,12 @@ discard block |
||
| 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 $e) { |
|
| 62 | + } catch (\Google_Service_Exception $e) { |
|
| 63 | 63 | return $this->handleGoogleServiceException($e); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | try { |
| 99 | 99 | $response = Analytics::$plugin->getReports()->getRealtimeReport($request); |
| 100 | - } catch(\Google_Service_Exception $e) { |
|
| 100 | + } catch (\Google_Service_Exception $e) { |
|
| 101 | 101 | return $this->handleGoogleServiceException($e); |
| 102 | 102 | } |
| 103 | 103 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | |
| 191 | 191 | return $this->asJson($response); |
| 192 | - } catch(\Google_Service_Exception $e) { |
|
| 192 | + } catch (\Google_Service_Exception $e) { |
|
| 193 | 193 | return $this->handleGoogleServiceException($e); |
| 194 | 194 | } |
| 195 | 195 | } |
@@ -208,7 +208,7 @@ discard block |
||
| 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 | |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | |
| 348 | 348 | $totalRevenue = 0; |
| 349 | 349 | |
| 350 | - foreach($rows as $row) { |
|
| 350 | + foreach ($rows as $row) { |
|
| 351 | 351 | $totalRevenue += $row[1]; |
| 352 | 352 | } |
| 353 | 353 | |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | $reportsResponse = $this->getReportingReports($criterias); |
| 70 | 70 | |
| 71 | 71 | if ($toArray) { |
| 72 | - $reportsResponseArray = (array)$reportsResponse->toSimpleObject(); |
|
| 72 | + $reportsResponseArray = (array) $reportsResponse->toSimpleObject(); |
|
| 73 | 73 | |
| 74 | 74 | return $reportsResponseArray['reports']; |
| 75 | 75 | } |
@@ -61,10 +61,10 @@ discard block |
||
| 61 | 61 | $settings = Json::decode($settingsJson); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - if($settings) { |
|
| 64 | + if ($settings) { |
|
| 65 | 65 | $forceConnect = $settings['forceConnect']; |
| 66 | 66 | |
| 67 | - if(isset($settings['token'])) { |
|
| 67 | + if (isset($settings['token'])) { |
|
| 68 | 68 | $token = $settings['token']; |
| 69 | 69 | } |
| 70 | 70 | } |
@@ -79,10 +79,10 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | // Get rid of the old plugin settings |
| 81 | 81 | echo ' > remove old plugin settings ...'; |
| 82 | - if($settings) { |
|
| 82 | + if ($settings) { |
|
| 83 | 83 | unset($settings['forceConnect']); |
| 84 | 84 | |
| 85 | - if(isset($settings['token'])) { |
|
| 85 | + if (isset($settings['token'])) { |
|
| 86 | 86 | unset($settings['token']); |
| 87 | 87 | } |
| 88 | 88 | |