@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function __construct($keywords, $solrConfiguration = null) |
157 | 157 | { |
158 | - $keywords = (string) $keywords; |
|
158 | + $keywords = (string)$keywords; |
|
159 | 159 | if ($solrConfiguration == null) { |
160 | 160 | $this->solrConfiguration = Util::getSolrConfiguration(); |
161 | 161 | } else { |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | */ |
677 | 677 | public function getGroupFields() |
678 | 678 | { |
679 | - return (array) $this->getQueryParameter('group.field', []); |
|
679 | + return (array)$this->getQueryParameter('group.field', []); |
|
680 | 680 | } |
681 | 681 | |
682 | 682 | /** |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | */ |
700 | 700 | public function getGroupSortings() |
701 | 701 | { |
702 | - return (array) $this->getQueryParameter('group.sort', []); |
|
702 | + return (array)$this->getQueryParameter('group.sort', []); |
|
703 | 703 | } |
704 | 704 | |
705 | 705 | // faceting |
@@ -725,7 +725,7 @@ discard block |
||
725 | 725 | */ |
726 | 726 | public function getGroupQueries() |
727 | 727 | { |
728 | - return (array) $this->getQueryParameter('group.query', []); |
|
728 | + return (array)$this->getQueryParameter('group.query', []); |
|
729 | 729 | } |
730 | 730 | |
731 | 731 | /** |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | * |
194 | 194 | * @param string $msg |
195 | 195 | * @param int $severity |
196 | - * @param mixed $dataVar |
|
196 | + * @param string[] $dataVar |
|
197 | 197 | */ |
198 | 198 | protected function writeDevLog($msg, $severity = 0, $dataVar = false) |
199 | 199 | { |
@@ -1003,7 +1003,7 @@ discard block |
||
1003 | 1003 | /** |
1004 | 1004 | * Sets the fields to return by a query. |
1005 | 1005 | * |
1006 | - * @param array|string $fieldList an array or comma-separated list of field names |
|
1006 | + * @param string $fieldList an array or comma-separated list of field names |
|
1007 | 1007 | * @throws \UnexpectedValueException on parameters other than comma-separated lists and arrays |
1008 | 1008 | */ |
1009 | 1009 | public function setFieldList($fieldList = array('*', 'score')) |
@@ -1079,7 +1079,7 @@ discard block |
||
1079 | 1079 | * |
1080 | 1080 | * This query supports the complete Lucene Query Language. |
1081 | 1081 | * |
1082 | - * @param mixed $alternativeQuery String alternative query or boolean FALSE to disable / reset the q.alt parameter. |
|
1082 | + * @param string $alternativeQuery String alternative query or boolean FALSE to disable / reset the q.alt parameter. |
|
1083 | 1083 | * @see http://wiki.apache.org/solr/DisMaxQParserPlugin#q.alt |
1084 | 1084 | */ |
1085 | 1085 | public function setAlternativeQuery($alternativeQuery) |
@@ -324,7 +324,7 @@ |
||
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 | { |
@@ -287,8 +287,8 @@ |
||
287 | 287 | |
288 | 288 | $mountedPagesIdsWithQueueItems = []; |
289 | 289 | foreach ($queueItemsOfExistingMountPoints as $id => $queueItemsOfExistingMountPoint) { |
290 | - if (((int) $queueItemsOfExistingMountPoint['queueItemCount']) > 0) { |
|
291 | - $mountedPagesIdsWithQueueItems[] = (int) $id; |
|
290 | + if (((int)$queueItemsOfExistingMountPoint['queueItemCount']) > 0) { |
|
291 | + $mountedPagesIdsWithQueueItems[] = (int)$id; |
|
292 | 292 | } |
293 | 293 | } |
294 | 294 |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | * |
233 | 233 | * Also does not report the time, see https://forge.typo3.org/issues/64551 |
234 | 234 | * |
235 | - * @param float|int $timeout maximum time to wait for ping in seconds, -1 for unlimited (default is 2) |
|
235 | + * @param integer $timeout maximum time to wait for ping in seconds, -1 for unlimited (default is 2) |
|
236 | 236 | * @param boolean $useCache indicates if the ping result should be cached in the instance or not |
237 | 237 | * @return bool TRUE if Solr can be reached, FALSE if not |
238 | 238 | */ |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | /** |
246 | 246 | * Call the /admin/ping servlet, can be used to get the runtime of a ping request. |
247 | 247 | * |
248 | - * @param float|int $timeout maximum time to wait for ping in seconds, -1 for unlimited (default is 2) |
|
248 | + * @param integer $timeout maximum time to wait for ping in seconds, -1 for unlimited (default is 2) |
|
249 | 249 | * @param boolean $useCache indicates if the ping result should be cached in the instance or not |
250 | 250 | * @return double runtime in milliseconds |
251 | 251 | * @throws \ApacheSolrForTypo3\Solr\PingFailedException |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | * |
483 | 483 | * @param string $url |
484 | 484 | * @param float|bool $timeout Read timeout in seconds |
485 | - * @return \Apache_Solr_Response |
|
485 | + * @return string |
|
486 | 486 | */ |
487 | 487 | protected function _sendRawGet($url, $timeout = false) |
488 | 488 | { |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | * a complete and well formed "delete" xml document |
657 | 657 | * |
658 | 658 | * @param string $rawPost Expected to be utf-8 encoded xml document |
659 | - * @param float|int $timeout Maximum expected duration of the delete operation on the server (otherwise, will throw a communication exception) |
|
659 | + * @param integer $timeout Maximum expected duration of the delete operation on the server (otherwise, will throw a communication exception) |
|
660 | 660 | * @return \Apache_Solr_Response |
661 | 661 | */ |
662 | 662 | public function delete($rawPost, $timeout = 3600) |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | */ |
277 | 277 | protected function performPingRequest($timeout = 2, $useCache = true) |
278 | 278 | { |
279 | - $cacheKey = (string) ($this); |
|
279 | + $cacheKey = (string)($this); |
|
280 | 280 | if ($useCache && isset(static::$pingCache[$cacheKey])) { |
281 | 281 | return static::$pingCache[$cacheKey]; |
282 | 282 | } |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | $solrconfigXmlUrl = $this->_scheme . '://' |
611 | 611 | . $this->_host . ':' . $this->_port |
612 | 612 | . $this->_path . 'admin/file/?file=solrconfig.xml'; |
613 | - $response= $this->_sendRawGet($solrconfigXmlUrl); |
|
613 | + $response = $this->_sendRawGet($solrconfigXmlUrl); |
|
614 | 614 | |
615 | 615 | $solrconfigXml = simplexml_load_string($response->getRawResponse()); |
616 | 616 | if ($solrconfigXml === false) { |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | { |
231 | 231 | /** @var $registry Registry */ |
232 | 232 | $registry = GeneralUtility::makeInstance(Registry::class); |
233 | - $servers = (array) $registry->get('tx_solr', 'servers', []); |
|
233 | + $servers = (array)$registry->get('tx_solr', 'servers', []); |
|
234 | 234 | return $servers; |
235 | 235 | } |
236 | 236 | |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | $recursionRootPageId = intval($rootPageId); |
315 | 315 | if ($rootPageId == 'SITE_ROOT') { |
316 | 316 | $recursionRootPageId = $this->rootPage['uid']; |
317 | - $pageIds[] = (int) $this->rootPage['uid']; |
|
317 | + $pageIds[] = (int)$this->rootPage['uid']; |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | if ($maxDepth <= 0) { |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'pid = ' . $recursionRootPageId . ' ' . BackendUtility::deleteClause('pages')); |
346 | 346 | |
347 | 347 | while ($page = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { |
348 | - $pageIds[] = (int) $page['uid']; |
|
348 | + $pageIds[] = (int)$page['uid']; |
|
349 | 349 | |
350 | 350 | if ($maxDepth > 1) { |
351 | 351 | $pageIds = array_merge($pageIds, $this->getPages($page['uid'], $maxDepth - 1)); |
@@ -53,7 +53,7 @@ |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | // try to create DateTime object |
56 | - $timezone = is_null($timezone) ? new DateTimeZone(date_default_timezone_get()) : $timezone; |
|
56 | + $timezone = is_null($timezone) ? new DateTimeZone(date_default_timezone_get()) : $timezone; |
|
57 | 57 | return $this->getFormattedDate($input, $inputFormat, $outputFormat, $timezone); |
58 | 58 | } |
59 | 59 |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $this->configuration = $site->getSolrConfiguration(); |
79 | 79 | $this->site = $site; |
80 | 80 | $this->indexQueue = is_null($queue) ? GeneralUtility::makeInstance(Queue::class) : $queue; |
81 | - $this->signalSlotDispatcher = is_null($dispatcher) ? GeneralUtility::makeInstance(Dispatcher::class) : $dispatcher; |
|
81 | + $this->signalSlotDispatcher = is_null($dispatcher) ? GeneralUtility::makeInstance(Dispatcher::class) : $dispatcher; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | protected function generateIndexingErrorLog(Item $itemToIndex, \Exception $e) |
141 | 141 | { |
142 | 142 | $message = 'Failed indexing Index Queue item ' . $itemToIndex->getIndexQueueUid(); |
143 | - $data = [ 'code' => $e->getCode(), |
|
143 | + $data = ['code' => $e->getCode(), |
|
144 | 144 | 'message' => $e->getMessage(), |
145 | 145 | 'trace' => $e->getTrace(), |
146 | 146 | 'item' => (array)$itemToIndex]; |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | { |
407 | 407 | $monitoredTables = []; |
408 | 408 | |
409 | - $indexingConfigurations = $this->getEnabledIndexQueueConfigurationNames(); |
|
409 | + $indexingConfigurations = $this->getEnabledIndexQueueConfigurationNames(); |
|
410 | 410 | foreach ($indexingConfigurations as $indexingConfigurationName) { |
411 | 411 | $monitoredTable = $this->getIndexQueueTableNameOrFallbackToConfigurationName($indexingConfigurationName); |
412 | 412 | $monitoredTables[] = $monitoredTable; |
@@ -532,13 +532,13 @@ discard block |
||
532 | 532 | public function getInitialPagesAdditionalWhereClause($defaultIfEmpty = ' AND 1=1') |
533 | 533 | { |
534 | 534 | $path = 'plugin.tx_solr.index.queue.pages' . '.initialPagesAdditionalWhereClause'; |
535 | - $initialPagesAdditionalWhereClause = $this->getValueByPathOrDefaultValue($path, ''); |
|
535 | + $initialPagesAdditionalWhereClause = $this->getValueByPathOrDefaultValue($path, ''); |
|
536 | 536 | |
537 | 537 | if (trim($initialPagesAdditionalWhereClause) === '') { |
538 | 538 | return $defaultIfEmpty; |
539 | 539 | } |
540 | 540 | |
541 | - return ' AND ' . $initialPagesAdditionalWhereClause; |
|
541 | + return ' AND ' . $initialPagesAdditionalWhereClause; |
|
542 | 542 | } |
543 | 543 | |
544 | 544 | /** |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | * |
605 | 605 | * @param string $configurationName |
606 | 606 | * @param string $defaultIfEmpty |
607 | - * @return mixed |
|
607 | + * @return string |
|
608 | 608 | */ |
609 | 609 | public function getIndexQueueInitializerClassByConfigurationName($configurationName, $defaultIfEmpty = 'ApacheSolrForTypo3\\Solr\\IndexQueue\\Initializer\\Record') |
610 | 610 | { |
@@ -1309,7 +1309,7 @@ discard block |
||
1309 | 1309 | * plugin.tx_solr.search.query.allowEmptyQuery |
1310 | 1310 | * |
1311 | 1311 | * @param string $defaultIfEmpty |
1312 | - * @return string |
|
1312 | + * @return boolean |
|
1313 | 1313 | */ |
1314 | 1314 | public function getSearchQueryAllowEmptyQuery($defaultIfEmpty = '') |
1315 | 1315 | { |
@@ -1371,7 +1371,7 @@ discard block |
||
1371 | 1371 | * |
1372 | 1372 | * plugin.tx_solr.search.query.returnFields |
1373 | 1373 | * |
1374 | - * @param array $defaultIfEmpty |
|
1374 | + * @param string[] $defaultIfEmpty |
|
1375 | 1375 | * @return array |
1376 | 1376 | */ |
1377 | 1377 | public function getSearchQueryReturnFieldsAsArray($defaultIfEmpty = array()) |
@@ -1956,7 +1956,7 @@ discard block |
||
1956 | 1956 | * plugin.tx_solr.index.enableCommits |
1957 | 1957 | * |
1958 | 1958 | * @param bool $defaultIfEmpty |
1959 | - * @return bool |
|
1959 | + * @return boolean|null |
|
1960 | 1960 | */ |
1961 | 1961 | public function getEnableCommits($defaultIfEmpty = true) |
1962 | 1962 | { |
@@ -827,7 +827,6 @@ discard block |
||
827 | 827 | * Returns if a log message should be written when a page was indexed. |
828 | 828 | * |
829 | 829 | * plugin.tx_solr.logging.indexing.pageIndexed |
830 | - |
|
831 | 830 | * @param bool $defaultIfEmpty |
832 | 831 | * @return bool |
833 | 832 | */ |
@@ -841,7 +840,6 @@ discard block |
||
841 | 840 | * Returns if a log message should be written when the TYPO3 search markers are missing in the page. |
842 | 841 | * |
843 | 842 | * plugin.tx_solr.logging.indexing.missingTypo3SearchMarkers |
844 | - |
|
845 | 843 | * @param bool $defaultIfEmpty |
846 | 844 | * @return bool |
847 | 845 | */ |
@@ -869,7 +867,6 @@ discard block |
||
869 | 867 | * Indicates if the debug mode is enabled or not. |
870 | 868 | * |
871 | 869 | * plugin.tx_solr.enableDebugMode |
872 | - |
|
873 | 870 | * @param bool $defaultIfEmpty |
874 | 871 | * @return bool |
875 | 872 | */ |
@@ -1960,8 +1957,8 @@ discard block |
||
1960 | 1957 | */ |
1961 | 1958 | public function getEnableCommits($defaultIfEmpty = true) |
1962 | 1959 | { |
1963 | - $enableCommits = $this->getValueByPathOrDefaultValue('plugin.tx_solr.index.enableCommits', $defaultIfEmpty); |
|
1964 | - $this->getBool($enableCommits); |
|
1960 | + $enableCommits = $this->getValueByPathOrDefaultValue('plugin.tx_solr.index.enableCommits', $defaultIfEmpty); |
|
1961 | + $this->getBool($enableCommits); |
|
1965 | 1962 | } |
1966 | 1963 | |
1967 | 1964 | } |
@@ -207,7 +207,7 @@ |
||
207 | 207 | $solrConnections = $connectionManager->getConnectionsBySite($site); |
208 | 208 | foreach ($solrConnections as $solr) { |
209 | 209 | $solr->deleteByQuery('type:' . $table . ' AND uid:' . intval($uid)); |
210 | - if($solrConfiguration->getEnableCommits()) { |
|
210 | + if ($solrConfiguration->getEnableCommits()) { |
|
211 | 211 | $solr->commit(false, false, false); |
212 | 212 | } |
213 | 213 | } |