@@ -43,9 +43,9 @@ discard block |
||
43 | 43 | public function getSearchStatistics($rootPageId, $days = 30, $limit = 10) |
44 | 44 | { |
45 | 45 | $now = time(); |
46 | - $timeStart = (int) ($now - 86400 * intval($days)); // 86400 seconds/day |
|
47 | - $rootPageId = (int) $rootPageId; |
|
48 | - $limit = (int) $limit; |
|
46 | + $timeStart = (int)($now - 86400 * intval($days)); // 86400 seconds/day |
|
47 | + $rootPageId = (int)$rootPageId; |
|
48 | + $limit = (int)$limit; |
|
49 | 49 | |
50 | 50 | $statisticsRows = $this->getDatabase()->exec_SELECTgetRows( |
51 | 51 | 'keywords, count(keywords) as count, num_found as hits', |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $sumCount += $statisticsRow['count']; |
64 | 64 | } |
65 | 65 | |
66 | - $statisticsRows = array_map(function ($row) use ($sumCount) { |
|
66 | + $statisticsRows = array_map(function($row) use ($sumCount) { |
|
67 | 67 | $row['percent'] = $row['count'] * 100 / $sumCount; |
68 | 68 | |
69 | 69 | return $row; |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | */ |
110 | 110 | protected function getTopKeyWordsWithOrWithoutHits($rootPageId, $days = 30, $limit, $withoutHits) |
111 | 111 | { |
112 | - $rootPageId = (int) $rootPageId; |
|
113 | - $limit = (int) $limit; |
|
114 | - $withoutHits = (bool) $withoutHits; |
|
112 | + $rootPageId = (int)$rootPageId; |
|
113 | + $limit = (int)$limit; |
|
114 | + $withoutHits = (bool)$withoutHits; |
|
115 | 115 | |
116 | 116 | $now = time(); |
117 | 117 | $timeStart = $now - 86400 * intval($days); // 86400 seconds/day |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | // for the hits we need to take the average |
157 | 157 | $avgHits = $this->getAverageFromField($mergedRow, $statisticsRow, 'hits'); |
158 | - $mergedRow['hits'] = (int) $avgHits; |
|
158 | + $mergedRow['hits'] = (int)$avgHits; |
|
159 | 159 | |
160 | 160 | // for the count we need to take the sum, because it's the sum of searches |
161 | 161 | $mergedRow['count'] = $mergedRow['count'] + $statisticsRow['count']; |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | * @param string $fieldName |
200 | 200 | * @return float|int |
201 | 201 | */ |
202 | - protected function getAverageFromField(array &$mergedRow, array $statisticsRow, $fieldName) |
|
202 | + protected function getAverageFromField(array &$mergedRow, array $statisticsRow, $fieldName) |
|
203 | 203 | { |
204 | 204 | // when this is the first row we can take it. |
205 | 205 | if ($mergedRow['mergedrows'] === 1) { |
@@ -1561,7 +1561,7 @@ |
||
1561 | 1561 | * |
1562 | 1562 | * plugin.tx_solr.search.query.returnFields |
1563 | 1563 | * |
1564 | - * @param array $defaultIfEmpty |
|
1564 | + * @param string[] $defaultIfEmpty |
|
1565 | 1565 | * @return array |
1566 | 1566 | */ |
1567 | 1567 | public function getSearchQueryReturnFieldsAsArray($defaultIfEmpty = []) |
@@ -75,7 +75,7 @@ |
||
75 | 75 | */ |
76 | 76 | public function getResponsibleRootPageIds($table, $uid) |
77 | 77 | { |
78 | - $cacheKey = 'rootpageids-' . $table . '-'.$uid; |
|
78 | + $cacheKey = 'rootpageids-' . $table . '-' . $uid; |
|
79 | 79 | $cacheResult = $this->siteRootsCache->get($cacheKey); |
80 | 80 | if ($cacheResult !== false) { |
81 | 81 | return $cacheResult; |