@@ -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(); |
@@ -111,8 +111,7 @@ |
||
| 111 | 111 | { |
| 112 | 112 | $response['report'] = Analytics::$plugin->getApis()->getAnalyticsReporting()->getReport($this, $toArray); |
| 113 | 113 | $response['success'] = true; |
| 114 | - } |
|
| 115 | - catch(\Exception $e) |
|
| 114 | + } catch(\Exception $e) |
|
| 116 | 115 | { |
| 117 | 116 | $response['error'] = true; |
| 118 | 117 | $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 | /** |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | public function actionElement() |
| 29 | 29 | { |
| 30 | 30 | $elementId = Craft::$app->getRequest()->getRequiredParam('elementId'); |
| 31 | - $siteId = (int)Craft::$app->getRequest()->getRequiredParam('siteId'); |
|
| 31 | + $siteId = (int) Craft::$app->getRequest()->getRequiredParam('siteId'); |
|
| 32 | 32 | $metric = Craft::$app->getRequest()->getRequiredParam('metric'); |
| 33 | 33 | |
| 34 | 34 | $response = Analytics::$plugin->getReports()->getElementReport($elementId, $siteId, $metric); |
@@ -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 | } |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | $this->selectDimensionOptions = $this->getSelectOptions('DIMENSION'); |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | - if($filters) { |
|
| 286 | + if ($filters) { |
|
| 287 | 287 | $this->selectDimensionOptions = $this->filterOptions($this->selectDimensionOptions, $filters); |
| 288 | 288 | } |
| 289 | 289 | |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | $this->selectMetricOptions = $this->getSelectOptions('METRIC'); |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | - if($filters) { |
|
| 306 | + if ($filters) { |
|
| 307 | 307 | $this->selectMetricOptions = $this->filterOptions($this->selectMetricOptions, $filters); |
| 308 | 308 | } |
| 309 | 309 | |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | |
| 336 | 336 | // filters |
| 337 | 337 | |
| 338 | - if($filters) { |
|
| 338 | + if ($filters) { |
|
| 339 | 339 | $options = $this->filterOptions($options, $filters); |
| 340 | 340 | } |
| 341 | 341 | |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | */ |
| 424 | 424 | private function filterOptions(array $options, array $filters): array |
| 425 | 425 | { |
| 426 | - if(!$filters) { |
|
| 426 | + if (!$filters) { |
|
| 427 | 427 | return $options; |
| 428 | 428 | } |
| 429 | 429 | |