@@ -112,7 +112,7 @@ |
||
| 112 | 112 | $response['report'] = Analytics::$plugin->getApis()->getAnalyticsReporting()->getReport($this, $toArray); |
| 113 | 113 | $response['success'] = true; |
| 114 | 114 | } |
| 115 | - catch(\Exception $e) |
|
| 115 | + catch (\Exception $e) |
|
| 116 | 116 | { |
| 117 | 117 | $response['error'] = true; |
| 118 | 118 | $response['errorMessage'] = $e->getMessage(); |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | Analytics::$plugin->cache->set($cacheId, $response, $cacheDuration); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - return (array)$response; |
|
| 53 | + return (array) $response; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $reportsResponse = $this->getReportingReports($criterias); |
| 67 | 67 | |
| 68 | 68 | if ($toArray) { |
| 69 | - $reportsResponseArray = (array)$reportsResponse->toSimpleObject(); |
|
| 69 | + $reportsResponseArray = (array) $reportsResponse->toSimpleObject(); |
|
| 70 | 70 | |
| 71 | 71 | return $reportsResponseArray['reports']; |
| 72 | 72 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | if ($criteria->pageToken) { |
| 143 | - $pageToken = (string)$criteria->pageToken; |
|
| 143 | + $pageToken = (string) $criteria->pageToken; |
|
| 144 | 144 | $request->setPageToken($pageToken); |
| 145 | 145 | } |
| 146 | 146 | |
@@ -220,11 +220,11 @@ |
||
| 220 | 220 | case 'float': |
| 221 | 221 | case 'time': |
| 222 | 222 | case 'percent': |
| 223 | - return (float)$value; |
|
| 223 | + return (float) $value; |
|
| 224 | 224 | break; |
| 225 | 225 | |
| 226 | 226 | default: |
| 227 | - return (string)$value; |
|
| 227 | + return (string) $value; |
|
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | } |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | |
| 58 | 58 | // Make sure $forceConnect is going to be a boolean |
| 59 | 59 | if (is_string($this->forceConnect)) { |
| 60 | - $this->forceConnect = (bool)$this->forceConnect; |
|
| 60 | + $this->forceConnect = (bool) $this->forceConnect; |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | if (is_string($this->token)) { |
@@ -61,7 +61,7 @@ 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 | $token = $settings['token']; |
| 67 | 67 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | // Get rid of the old plugin settings |
| 78 | 78 | echo ' > remove old plugin settings ...'; |
| 79 | - if($settings) { |
|
| 79 | + if ($settings) { |
|
| 80 | 80 | unset($settings['forceConnect'], $settings['token']); |
| 81 | 81 | $settingsJson = Json::encode($settings); |
| 82 | 82 | $this->update('{{%plugins}}', ['settings' => $settingsJson], ['id' => $row['id']]); |
@@ -209,7 +209,7 @@ |
||
| 209 | 209 | |
| 210 | 210 | $infoRowExists = false; |
| 211 | 211 | |
| 212 | - if(Craft::$app->getDb()->tableExists('{{%analytics_info}}', false)) { |
|
| 212 | + if (Craft::$app->getDb()->tableExists('{{%analytics_info}}', false)) { |
|
| 213 | 213 | $infoRowExists = (new Query()) |
| 214 | 214 | ->from(['{{%analytics_info}}']) |
| 215 | 215 | ->one(); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | public function actionElement() |
| 49 | 49 | { |
| 50 | 50 | $elementId = Craft::$app->getRequest()->getRequiredParam('elementId'); |
| 51 | - $siteId = (int)Craft::$app->getRequest()->getRequiredParam('siteId'); |
|
| 51 | + $siteId = (int) Craft::$app->getRequest()->getRequiredParam('siteId'); |
|
| 52 | 52 | $metric = Craft::$app->getRequest()->getRequiredParam('metric'); |
| 53 | 53 | |
| 54 | 54 | $response = Analytics::$plugin->getReports()->getElementReport($elementId, $siteId, $metric); |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | |
| 305 | 305 | $totalRevenue = 0; |
| 306 | 306 | |
| 307 | - foreach($rows as $row) { |
|
| 307 | + foreach ($rows as $row) { |
|
| 308 | 308 | $totalRevenue += $row[1]; |
| 309 | 309 | } |
| 310 | 310 | |