@@ -26,7 +26,6 @@ |
||
26 | 26 | |
27 | 27 | use ApacheSolrForTypo3\Solr\System\Configuration\TypoScriptConfiguration; |
28 | 28 | use ApacheSolrForTypo3\Solr\Tests\Unit\UnitTest; |
29 | -use TYPO3\CMS\Core\Utility\GeneralUtility; |
|
30 | 29 | |
31 | 30 | /** |
32 | 31 | * Testcase to check if the configuration object can be used as expected |
@@ -201,6 +201,7 @@ |
||
201 | 201 | * |
202 | 202 | * @param array $mergedRow |
203 | 203 | * @param array $statisticsRow |
204 | + * @param string $fieldName |
|
204 | 205 | * @return float|int |
205 | 206 | */ |
206 | 207 | protected function getAverageFromField(array &$mergedRow, array $statisticsRow, $fieldName) |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | public function getSearchStatistics($rootPageId, $days = 30, $limit = 10) |
47 | 47 | { |
48 | 48 | $now = time(); |
49 | - $timeStart = (int) ($now - 86400 * intval($days)); // 86400 seconds/day |
|
50 | - $rootPageId = (int) $rootPageId; |
|
51 | - $limit = (int) $limit; |
|
49 | + $timeStart = (int)($now - 86400 * intval($days)); // 86400 seconds/day |
|
50 | + $rootPageId = (int)$rootPageId; |
|
51 | + $limit = (int)$limit; |
|
52 | 52 | |
53 | 53 | $statisticsRows = $this->getDatabase()->exec_SELECTgetRows( |
54 | 54 | 'keywords, count(keywords) as count, num_found as hits', |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $sumCount += $statisticsRow['count']; |
67 | 67 | } |
68 | 68 | |
69 | - $statisticsRows = array_map(function ($row) use ($sumCount) { |
|
69 | + $statisticsRows = array_map(function($row) use ($sumCount) { |
|
70 | 70 | $row['percent'] = $row['count'] * 100 / $sumCount; |
71 | 71 | |
72 | 72 | return $row; |
@@ -112,9 +112,9 @@ discard block |
||
112 | 112 | */ |
113 | 113 | protected function getTopKeyWordsWithOrWithoutHits($rootPageId, $days = 30, $limit, $withoutHits) |
114 | 114 | { |
115 | - $rootPageId = (int) $rootPageId; |
|
116 | - $limit = (int) $limit; |
|
117 | - $withoutHits = (bool) $withoutHits; |
|
115 | + $rootPageId = (int)$rootPageId; |
|
116 | + $limit = (int)$limit; |
|
117 | + $withoutHits = (bool)$withoutHits; |
|
118 | 118 | |
119 | 119 | $now = time(); |
120 | 120 | $timeStart = $now - 86400 * intval($days); // 86400 seconds/day |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | |
160 | 160 | // for the hits we need to take the average |
161 | 161 | $avgHits = $this->getAverageFromField($mergedRow, $statisticsRow, 'hits'); |
162 | - $mergedRow['hits'] = (int) $avgHits; |
|
162 | + $mergedRow['hits'] = (int)$avgHits; |
|
163 | 163 | |
164 | 164 | // for the count we need to take the sum, because it's the sum of searches |
165 | 165 | $mergedRow['count'] = $mergedRow['count'] + $statisticsRow['count']; |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | * @param array $statisticsRow |
204 | 204 | * @return float|int |
205 | 205 | */ |
206 | - protected function getAverageFromField(array &$mergedRow, array $statisticsRow, $fieldName) |
|
206 | + protected function getAverageFromField(array &$mergedRow, array $statisticsRow, $fieldName) |
|
207 | 207 | { |
208 | 208 | // when this is the first row we can take it. |
209 | 209 | if ($mergedRow['mergedrows'] === 1) { |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
172 | - * @param $table |
|
172 | + * @param string $table |
|
173 | 173 | * @param $uid |
174 | 174 | * @param $changedFields |
175 | 175 | * @param $indexQueue |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | * |
350 | 350 | * @param string $table The record's table name. |
351 | 351 | * @param integer $record The record's uid. |
352 | - * @return array The cleaned record |
|
352 | + * @return integer The cleaned record |
|
353 | 353 | */ |
354 | 354 | protected function normalizeFrontendGroupField($table, $record) |
355 | 355 | { |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | * determines whether it is set on the current record. |
419 | 419 | * |
420 | 420 | * @param string $table The table name. |
421 | - * @param array $record An array with record fields that may affect visibility. |
|
421 | + * @param integer $record An array with record fields that may affect visibility. |
|
422 | 422 | * @return boolean True if the record is hidden, FALSE otherwise. |
423 | 423 | */ |
424 | 424 | protected function isHidden($table, $record) |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | * making the record invisible on the website. |
440 | 440 | * |
441 | 441 | * @param string $table The table name. |
442 | - * @param array $record An array with record fields that may affect visibility. |
|
442 | + * @param integer $record An array with record fields that may affect visibility. |
|
443 | 443 | * @return boolean True if the record's start time is in the future, FALSE otherwise. |
444 | 444 | */ |
445 | 445 | protected function isStartTimeInFuture($table, $record) |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | * indexed already. |
460 | 460 | * |
461 | 461 | * @param string $table The table name. |
462 | - * @param array $record An array with record fields that may affect visibility. |
|
462 | + * @param integer $record An array with record fields that may affect visibility. |
|
463 | 463 | * @return boolean True if the record is marked as being indexed |
464 | 464 | */ |
465 | 465 | protected function isMarkedAsIndexed($table, $record) |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | * the record invisible to at least some people. |
475 | 475 | * |
476 | 476 | * @param string $table The table name. |
477 | - * @param array $record An array with record fields that may affect visibility. |
|
477 | + * @param integer $record An array with record fields that may affect visibility. |
|
478 | 478 | * @return boolean TRUE if frontend groups have been removed from access to the record, FALSE otherwise. |
479 | 479 | */ |
480 | 480 | protected function hasFrontendGroupsRemoved($table, $record) |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | /** |
502 | 502 | * Checks whether the page has been excluded from searching. |
503 | 503 | * |
504 | - * @param array $record An array with record fields that may affect visibility. |
|
504 | + * @param integer $record An array with record fields that may affect visibility. |
|
505 | 505 | * @return boolean True if the page has been excluded from searching, FALSE otherwise |
506 | 506 | */ |
507 | 507 | protected function isPageExcludedFromSearch($record) |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | * Checks whether a page has a page type that can be indexed. |
514 | 514 | * Currently standard pages and mount pages can be indexed. |
515 | 515 | * |
516 | - * @param array $record A page record |
|
516 | + * @param integer $record A page record |
|
517 | 517 | * @return boolean TRUE if the page can be indexed according to its page type, FALSE otherwise |
518 | 518 | */ |
519 | 519 | protected function isIndexablePageType(array $record) |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | /** |
205 | 205 | * Generates the headers to be send with the request. |
206 | 206 | * |
207 | - * @return array Array of HTTP headers. |
|
207 | + * @return string[] Array of HTTP headers. |
|
208 | 208 | */ |
209 | 209 | public function getHeaders() |
210 | 210 | { |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | * Sets a request's parameter and its value. |
325 | 325 | * |
326 | 326 | * @param string $parameter Parameter name |
327 | - * @param mixed $value Parameter value. |
|
327 | + * @param string $value Parameter value. |
|
328 | 328 | */ |
329 | 329 | public function setParameter($parameter, $value) |
330 | 330 | { |
@@ -39,9 +39,9 @@ |
||
39 | 39 | */ |
40 | 40 | protected $configuration; |
41 | 41 | |
42 | - /** |
|
43 | - * @var string |
|
44 | - */ |
|
42 | + /** |
|
43 | + * @var string |
|
44 | + */ |
|
45 | 45 | protected $prefix; |
46 | 46 | |
47 | 47 | /** |
@@ -157,7 +157,7 @@ |
||
157 | 157 | */ |
158 | 158 | public function __construct($keywords, $solrConfiguration = null) |
159 | 159 | { |
160 | - $keywords = (string) $keywords; |
|
160 | + $keywords = (string)$keywords; |
|
161 | 161 | if ($solrConfiguration == null) { |
162 | 162 | $this->solrConfiguration = Util::getSolrConfiguration(); |
163 | 163 | } else { |