@@ -25,10 +25,8 @@ |
||
| 25 | 25 | ***************************************************************/ |
| 26 | 26 | |
| 27 | 27 | use ApacheSolrForTypo3\Solr\Site; |
| 28 | -use ApacheSolrForTypo3\Solr\Util; |
|
| 29 | 28 | use TYPO3\CMS\Backend\Form\FormResultCompiler; |
| 30 | 29 | use TYPO3\CMS\Backend\Form\NodeFactory; |
| 31 | -use TYPO3\CMS\Core\Page\PageRenderer; |
|
| 32 | 30 | use TYPO3\CMS\Core\Utility\GeneralUtility; |
| 33 | 31 | |
| 34 | 32 | /** |
@@ -26,7 +26,6 @@ |
||
| 26 | 26 | |
| 27 | 27 | use TYPO3\CMS\Backend\Toolbar\ClearCacheActionsHookInterface; |
| 28 | 28 | use TYPO3\CMS\Backend\Utility\BackendUtility; |
| 29 | -use TYPO3\CMS\Backend\Utility\IconUtility; |
|
| 30 | 29 | use TYPO3\CMS\Core\SingletonInterface; |
| 31 | 30 | use TYPO3\CMS\Core\Utility\GeneralUtility; |
| 32 | 31 | use TYPO3\CMS\Core\Imaging\Icon; |
@@ -119,7 +119,6 @@ |
||
| 119 | 119 | /** |
| 120 | 120 | * Gets the related items of the current record's configured field. |
| 121 | 121 | * |
| 122 | - * @param array $configuration for the content object |
|
| 123 | 122 | * @param ContentObjectRenderer $parentContentObject parent content object |
| 124 | 123 | * @return array Array of related items, values already resolved from related records |
| 125 | 124 | */ |
@@ -25,7 +25,6 @@ |
||
| 25 | 25 | ***************************************************************/ |
| 26 | 26 | |
| 27 | 27 | use ApacheSolrForTypo3\Solr\Tests\Unit\UnitTest; |
| 28 | -use ApacheSolrForTypo3\Solr\Util; |
|
| 29 | 28 | use ApacheSolrForTypo3\Solr\ViewHelper\Ts; |
| 30 | 29 | use TYPO3\CMS\Core\TypoScript\TemplateService; |
| 31 | 30 | use TYPO3\CMS\Core\Utility\GeneralUtility; |
@@ -294,7 +294,7 @@ |
||
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | /** |
| 297 | - * @param $site |
|
| 297 | + * @param Site $site |
|
| 298 | 298 | */ |
| 299 | 299 | protected function setSiteAndResetCore($site) |
| 300 | 300 | { |
@@ -169,10 +169,10 @@ |
||
| 169 | 169 | { |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | - /** |
|
| 173 | - * Call a sub-module's controller |
|
| 174 | - * |
|
| 175 | - */ |
|
| 172 | + /** |
|
| 173 | + * Call a sub-module's controller |
|
| 174 | + * |
|
| 175 | + */ |
|
| 176 | 176 | protected function invokeModuleController() |
| 177 | 177 | { |
| 178 | 178 | $activeModuleDescription = $this->moduleManager->getModuleDescription($this->activeModuleName); |
@@ -136,7 +136,7 @@ |
||
| 136 | 136 | /** |
| 137 | 137 | * Emits a signal after all items was indexed |
| 138 | 138 | * |
| 139 | - * @param array $itemsToIndex |
|
| 139 | + * @param Item[] $itemsToIndex |
|
| 140 | 140 | */ |
| 141 | 141 | protected function emitAfterIndexItemsSignal($itemsToIndex) |
| 142 | 142 | { |
@@ -30,14 +30,9 @@ |
||
| 30 | 30 | use ApacheSolrForTypo3\Solr\IndexQueue\Queue; |
| 31 | 31 | use ApacheSolrForTypo3\Solr\Site; |
| 32 | 32 | use ApacheSolrForTypo3\Solr\System\Configuration\TypoScriptConfiguration; |
| 33 | -use ApacheSolrForTypo3\Solr\System\Environment\CliEnvironment; |
|
| 34 | 33 | use ApacheSolrForTypo3\Solr\Task\IndexQueueWorkerTask; |
| 35 | -use ApacheSolrForTypo3\Solr\Util; |
|
| 36 | 34 | use TYPO3\CMS\Backend\Utility\BackendUtility; |
| 37 | -use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; |
|
| 38 | 35 | use TYPO3\CMS\Core\Utility\GeneralUtility; |
| 39 | -use TYPO3\CMS\Core\SingletonInterface; |
|
| 40 | -use TYPO3\CMS\Core\Utility\ArrayUtility; |
|
| 41 | 36 | |
| 42 | 37 | /** |
| 43 | 38 | * Service to perform indexing operations |
@@ -136,7 +136,7 @@ |
||
| 136 | 136 | /** |
| 137 | 137 | * Gets the last searched keywords from the database |
| 138 | 138 | * |
| 139 | - * @param integer|bool $limit |
|
| 139 | + * @param integer $limit |
|
| 140 | 140 | * @return array An array containing the last searches of the current user |
| 141 | 141 | */ |
| 142 | 142 | protected function getLastSearchesFromDatabase($limit = false) |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | public function addToLastSearches($keywords) |
| 100 | 100 | { |
| 101 | - $mode = $this->configuration->getSearchLastSearchesMode(); |
|
| 101 | + $mode = $this->configuration->getSearchLastSearchesMode(); |
|
| 102 | 102 | switch ($mode) { |
| 103 | 103 | case 'user': |
| 104 | 104 | $this->storeKeywordsToSession($keywords); |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | protected function getNextSequenceId() |
| 228 | 228 | { |
| 229 | 229 | $nextSequenceId = 0; |
| 230 | - $numberOfLastSearchesToLog = (int) $this->configuration->getSearchLastSearchesLimit(); |
|
| 230 | + $numberOfLastSearchesToLog = (int)$this->configuration->getSearchLastSearchesLimit(); |
|
| 231 | 231 | |
| 232 | 232 | $row = $this->database->exec_SELECTgetRows( |
| 233 | 233 | '(sequence_id + 1) % ' . $numberOfLastSearchesToLog . ' as next_sequence_id', |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | /** |
| 422 | 422 | * Checks it the results should be hidden in the response. |
| 423 | 423 | * |
| 424 | - * @param $rawQuery |
|
| 424 | + * @param string $rawQuery |
|
| 425 | 425 | * @return bool |
| 426 | 426 | */ |
| 427 | 427 | protected function shouldHideResultsFromInitialSearch($rawQuery) |
@@ -613,7 +613,7 @@ discard block |
||
| 613 | 613 | } |
| 614 | 614 | |
| 615 | 615 | /** |
| 616 | - * @param $requestedPerPage |
|
| 616 | + * @param integer $requestedPerPage |
|
| 617 | 617 | */ |
| 618 | 618 | protected function setPerPageInSession($requestedPerPage) |
| 619 | 619 | { |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | * @param Query $query The query that has been searched for. |
| 288 | 288 | * @param \Apache_Solr_Response $response The search's response. |
| 289 | 289 | */ |
| 290 | - protected function processResponse($rawQuery, Query $query, \Apache_Solr_Response &$response) |
|
| 290 | + protected function processResponse($rawQuery, Query $query, \Apache_Solr_Response & $response) |
|
| 291 | 291 | { |
| 292 | 292 | if ($this->shouldHideResultsFromInitialSearch($rawQuery)) { |
| 293 | 293 | // explicitly set number of results to 0 as we just wanted |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | * |
| 316 | 316 | * @param \Apache_Solr_Response $response |
| 317 | 317 | */ |
| 318 | - protected function addExpandedDocumentsFromVariants(\Apache_Solr_Response &$response) |
|
| 318 | + protected function addExpandedDocumentsFromVariants(\Apache_Solr_Response & $response) |
|
| 319 | 319 | { |
| 320 | 320 | if (!is_array($response->response->docs)) { |
| 321 | 321 | return; |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | * @param \Apache_Solr_Response $response |
| 368 | 368 | * @throws \InvalidArgumentException |
| 369 | 369 | */ |
| 370 | - protected function wrapResultDocumentInResultObject(\Apache_Solr_Response &$response) |
|
| 370 | + protected function wrapResultDocumentInResultObject(\Apache_Solr_Response & $response) |
|
| 371 | 371 | { |
| 372 | 372 | if (!is_array($response->response->docs)) { |
| 373 | 373 | return; |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | $searchResultClassName = $this->getResultClassName(); |
| 393 | 393 | $result = GeneralUtility::makeInstance($searchResultClassName, $originalDocument); |
| 394 | 394 | if (!$result instanceof SearchResult) { |
| 395 | - throw new \InvalidArgumentException("Could not create result object with class: " . (string) $searchResultClassName, 1470037679); |
|
| 395 | + throw new \InvalidArgumentException("Could not create result object with class: " . (string)$searchResultClassName, 1470037679); |
|
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | return $result; |
@@ -404,8 +404,7 @@ discard block |
||
| 404 | 404 | protected function getResultClassName() |
| 405 | 405 | { |
| 406 | 406 | return isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultClassName ']) ? |
| 407 | - $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultClassName '] : |
|
| 408 | - 'ApacheSolrForTypo3\\Solr\\Domain\\Search\\ResultSet\\SearchResult'; |
|
| 407 | + $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultClassName '] : 'ApacheSolrForTypo3\\Solr\\Domain\\Search\\ResultSet\\SearchResult'; |
|
| 409 | 408 | } |
| 410 | 409 | |
| 411 | 410 | /** |
@@ -414,8 +413,7 @@ discard block |
||
| 414 | 413 | protected function getResultSetClassName() |
| 415 | 414 | { |
| 416 | 415 | return isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultSetClassName ']) ? |
| 417 | - $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultSetClassName '] : |
|
| 418 | - 'ApacheSolrForTypo3\\Solr\\Domain\\Search\\ResultSet\\SearchResultSet'; |
|
| 416 | + $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['searchResultSetClassName '] : 'ApacheSolrForTypo3\\Solr\\Domain\\Search\\ResultSet\\SearchResultSet'; |
|
| 419 | 417 | } |
| 420 | 418 | |
| 421 | 419 | /** |
@@ -561,7 +559,7 @@ discard block |
||
| 561 | 559 | $response = $this->search->search($query, 0, 1); |
| 562 | 560 | $this->processResponse($documentId, $query, $response); |
| 563 | 561 | |
| 564 | - $resultDocument = isset($response->response->docs[0]) ? $response->response->docs[0] : null; |
|
| 562 | + $resultDocument = isset($response->response->docs[0]) ? $response->response->docs[0] : null; |
|
| 565 | 563 | return $resultDocument; |
| 566 | 564 | } |
| 567 | 565 | |
@@ -29,7 +29,6 @@ |
||
| 29 | 29 | use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\SearchResultSetService; |
| 30 | 30 | use ApacheSolrForTypo3\Solr\Domain\Search\SearchRequest; |
| 31 | 31 | use ApacheSolrForTypo3\Solr\Search; |
| 32 | -use ApacheSolrForTypo3\Solr\SolrService; |
|
| 33 | 32 | use ApacheSolrForTypo3\Solr\System\Configuration\TypoScriptConfiguration; |
| 34 | 33 | use ApacheSolrForTypo3\Solr\Tests\Unit\UnitTest; |
| 35 | 34 | use TYPO3\CMS\Frontend\Plugin\AbstractPlugin; |
@@ -24,12 +24,9 @@ |
||
| 24 | 24 | * |
| 25 | 25 | * This copyright notice MUST APPEAR in all copies of the script! |
| 26 | 26 | ***************************************************************/ |
| 27 | -use ApacheSolrForTypo3\Solr\System\Configuration\ConfigurationManager; |
|
| 28 | 27 | use ApacheSolrForTypo3\Solr\System\Configuration\TypoScriptConfiguration; |
| 29 | 28 | use ApacheSolrForTypo3\Solr\System\Util\ArrayAccessor; |
| 30 | -use ApacheSolrForTypo3\Solr\Util; |
|
| 31 | 29 | use TYPO3\CMS\Core\Utility\ArrayUtility; |
| 32 | -use TYPO3\CMS\Core\Utility\GeneralUtility; |
|
| 33 | 30 | |
| 34 | 31 | /** |
| 35 | 32 | * The searchRequest is used to act as an api to the arguments that have been passed |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | protected function prefixWithNamespace($path) |
| 145 | 145 | { |
| 146 | - return $this->argumentNameSpace . ':'.$path; |
|
| 146 | + return $this->argumentNameSpace . ':' . $path; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /** |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | $facetValues = $this->getActiveFacets(); |
| 230 | - $facetValues[] = $facetName.':'.$facetValue; |
|
| 230 | + $facetValues[] = $facetName . ':' . $facetValue; |
|
| 231 | 231 | $this->setActiveFacets($facetValues); |
| 232 | 232 | |
| 233 | 233 | $this->stateChanged = true; |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | return $this; |
| 249 | 249 | } |
| 250 | 250 | $facetValues = $this->getActiveFacets(); |
| 251 | - $facetValueToLookFor = $facetName.':'.$facetValue; |
|
| 251 | + $facetValueToLookFor = $facetName . ':' . $facetValue; |
|
| 252 | 252 | |
| 253 | 253 | foreach ($facetValues as $index => $facetValue) { |
| 254 | 254 | if ($facetValue === $facetValueToLookFor) { |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | */ |
| 307 | 307 | public function getHasFacetValue($facetName, $facetValue) |
| 308 | 308 | { |
| 309 | - $facetNameAndValueToCheck = $facetName.':'.$facetValue; |
|
| 309 | + $facetNameAndValueToCheck = $facetName . ':' . $facetValue; |
|
| 310 | 310 | foreach ($this->getActiveFacets() as $activeFacet) { |
| 311 | 311 | if ($activeFacet == $facetNameAndValueToCheck) { |
| 312 | 312 | return true; |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | */ |
| 393 | 393 | public function setSorting($sortingName, $direction = 'asc') |
| 394 | 394 | { |
| 395 | - $value = $sortingName.' '.$direction; |
|
| 395 | + $value = $sortingName . ' ' . $direction; |
|
| 396 | 396 | $path = $this->prefixWithNamespace('sort'); |
| 397 | 397 | $this->argumentsAccessor->set($path, $value); |
| 398 | 398 | $this->stateChanged = true; |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | /** |
| 139 | 139 | * Helper method to prefix an accessor with the arguments namespace. |
| 140 | 140 | * |
| 141 | - * @param $path |
|
| 141 | + * @param string $path |
|
| 142 | 142 | * @return string |
| 143 | 143 | */ |
| 144 | 144 | protected function prefixWithNamespace($path) |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | |
| 201 | 201 | /** |
| 202 | 202 | * @param $activeFacets |
| 203 | - * @return array|null |
|
| 203 | + * @return SearchRequest |
|
| 204 | 204 | * |
| 205 | 205 | * @return SearchRequest |
| 206 | 206 | */ |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | /** |
| 329 | 329 | * Returns the sorting string in the url e.g. title asc. |
| 330 | 330 | * |
| 331 | - * @return string|null |
|
| 331 | + * @return string |
|
| 332 | 332 | */ |
| 333 | 333 | protected function getSorting() |
| 334 | 334 | { |
@@ -339,8 +339,8 @@ discard block |
||
| 339 | 339 | /** |
| 340 | 340 | * Helper function to get the sorting configuration name or direction. |
| 341 | 341 | * |
| 342 | - * @param $index |
|
| 343 | - * @return null |
|
| 342 | + * @param integer $index |
|
| 343 | + * @return string |
|
| 344 | 344 | */ |
| 345 | 345 | protected function getSortingPart($index) |
| 346 | 346 | { |
@@ -153,6 +153,7 @@ |
||
| 153 | 153 | /** |
| 154 | 154 | * Renders a numeric range facet by providing a slider |
| 155 | 155 | * |
| 156 | + * @return string |
|
| 156 | 157 | */ |
| 157 | 158 | abstract protected function renderFacetOptions(); |
| 158 | 159 | |