@@ -173,7 +173,7 @@ |
||
173 | 173 | 'auth', // service type |
174 | 174 | AuthorizationService::class, |
175 | 175 | // service key |
176 | - [ // service meta data |
|
176 | + [// service meta data |
|
177 | 177 | 'title' => 'Solr Indexer Authorization', |
178 | 178 | 'description' => 'Authorizes the Solr Index Queue indexer to access protected pages.', |
179 | 179 |
@@ -48,7 +48,7 @@ |
||
48 | 48 | */ |
49 | 49 | public function __construct($TCA = null) |
50 | 50 | { |
51 | - $this->tca = (array) (is_null($TCA) ? $GLOBALS['TCA'] : $TCA); |
|
51 | + $this->tca = (array)(is_null($TCA) ? $GLOBALS['TCA'] : $TCA); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -51,14 +51,14 @@ |
||
51 | 51 | public function execute(array $arguments = []) |
52 | 52 | { |
53 | 53 | try { |
54 | - $iterator = unserialize($arguments[0]); |
|
54 | + $iterator = unserialize($arguments[0]); |
|
55 | 55 | } catch (\Exception $e) { |
56 | 56 | $iterator = []; |
57 | 57 | } |
58 | 58 | if ($iterator === false) { |
59 | 59 | $iterator = []; |
60 | 60 | } |
61 | - $variable = $arguments[1]; |
|
61 | + $variable = $arguments[1]; |
|
62 | 62 | |
63 | 63 | $data = ''; |
64 | 64 | foreach ($iterator as $value) { |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | * @param Query $query The query that has been searched for. |
283 | 283 | * @param \Apache_Solr_Response $response The search's response. |
284 | 284 | */ |
285 | - protected function processResponse($rawQuery, Query $query, \Apache_Solr_Response &$response) |
|
285 | + protected function processResponse($rawQuery, Query $query, \Apache_Solr_Response & $response) |
|
286 | 286 | { |
287 | 287 | if ($this->shouldHideResultsFromInitialSearch($rawQuery)) { |
288 | 288 | // explicitly set number of results to 0 as we just wanted |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | * |
311 | 311 | * @param \Apache_Solr_Response $response |
312 | 312 | */ |
313 | - protected function addExpandedDocumentsFromVariants(\Apache_Solr_Response &$response) |
|
313 | + protected function addExpandedDocumentsFromVariants(\Apache_Solr_Response & $response) |
|
314 | 314 | { |
315 | 315 | if (!is_array($response->response->docs)) { |
316 | 316 | return; |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | * @param \Apache_Solr_Response $response |
363 | 363 | * @throws \Apache_Solr_ParserException |
364 | 364 | */ |
365 | - protected function wrapResultDocumentInResultObject(\Apache_Solr_Response &$response) |
|
365 | + protected function wrapResultDocumentInResultObject(\Apache_Solr_Response & $response) |
|
366 | 366 | { |
367 | 367 | try { |
368 | 368 | $documents = $response->response->docs; |
@@ -241,6 +241,9 @@ |
||
241 | 241 | $this->record = $record; |
242 | 242 | } |
243 | 243 | |
244 | + /** |
|
245 | + * @return integer |
|
246 | + */ |
|
244 | 247 | public function getRecordPageId() |
245 | 248 | { |
246 | 249 | $this->getRecord(); |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | * different value for non-database-record types. |
379 | 379 | * @param string $additionalRecordFields for sql-query |
380 | 380 | * |
381 | - * @return array|NULL |
|
381 | + * @return string |
|
382 | 382 | */ |
383 | 383 | protected function getRecordCached($itemType, $itemUid, $additionalRecordFields) |
384 | 384 | { |
@@ -925,7 +925,7 @@ discard block |
||
925 | 925 | * Marks an item as failed and causes the indexer to skip the item in the |
926 | 926 | * next run. |
927 | 927 | * |
928 | - * @param int|Item $item Either the item's Index Queue |
|
928 | + * @param Item $item Either the item's Index Queue |
|
929 | 929 | * uid or the complete item |
930 | 930 | * @param string $errorMessage Error message |
931 | 931 | */ |
@@ -75,7 +75,7 @@ |
||
75 | 75 | */ |
76 | 76 | public function getResponsibleRootPageIds($table, $uid) |
77 | 77 | { |
78 | - $cacheId = 'RootPageResolver' . '_' . 'getResponsibleRootPageIds' . '_' . $table . '_'.$uid; |
|
78 | + $cacheId = 'RootPageResolver' . '_' . 'getResponsibleRootPageIds' . '_' . $table . '_' . $uid; |
|
79 | 79 | $methodResult = $this->runtimeCache->get($cacheId); |
80 | 80 | if (!empty($methodResult)) { |
81 | 81 | return $methodResult; |
@@ -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 = (array)$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) { |
@@ -353,7 +353,7 @@ |
||
353 | 353 | $value = array_pop($relatedItemsFromForeignTable); |
354 | 354 | |
355 | 355 | // restore |
356 | - $this->configuration= $backupConfiguration; |
|
356 | + $this->configuration = $backupConfiguration; |
|
357 | 357 | $parentContentObject->data = $backupRecord; |
358 | 358 | } |
359 | 359 |