Completed
Pull Request — master (#732)
by Claus
67:28 queued 42:34
created
Classes/Domain/Search/Statistics/StatisticsRepository.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -201,6 +201,7 @@
 block discarded – undo
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)
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
Classes/IndexQueue/PageIndexerRequest.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Classes/SuggestQuery.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,9 +39,9 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@
 block discarded – undo
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 {
Please login to merge, or discard this patch.
Classes/Plugin/Results/Results.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,6 @@
 block discarded – undo
29 29
 use ApacheSolrForTypo3\Solr\Domain\Search\SearchRequest;
30 30
 use ApacheSolrForTypo3\Solr\Plugin\CommandPluginBase;
31 31
 use ApacheSolrForTypo3\Solr\Plugin\PluginCommand;
32
-use ApacheSolrForTypo3\Solr\Query;
33 32
 use ApacheSolrForTypo3\Solr\System\Configuration\TypoScriptConfiguration;
34 33
 use ApacheSolrForTypo3\Solr\Template;
35 34
 use TYPO3\CMS\Core\Utility\GeneralUtility;
Please login to merge, or discard this patch.
Classes/Site.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -274,7 +274,7 @@
 block discarded – undo
274 274
      * Generates a list of page IDs in this site. Attention, this includes
275 275
      * all page types! Deleted pages are not included.
276 276
      *
277
-     * @param int|string $rootPageId Page ID from where to start collection sub pages
277
+     * @param integer $rootPageId Page ID from where to start collection sub pages
278 278
      * @param int $maxDepth Maximum depth to decend into the site tree
279 279
      * @return array Array of pages (IDs) in this site
280 280
      */
Please login to merge, or discard this patch.
Classes/SolrService.php 1 patch
Doc Comments   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
     /**
129 129
      * Returns the current time in milliseconds.
130 130
      *
131
-     * @return int
131
+     * @return double
132 132
      */
133 133
     protected function getMilliseconds()
134 134
     {
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
      *
175 175
      * Also does not report the time, see https://forge.typo3.org/issues/64551
176 176
      *
177
-     * @param float|int $timeout maximum time to wait for ping in seconds, -1 for unlimited (default is 2)
177
+     * @param integer $timeout maximum time to wait for ping in seconds, -1 for unlimited (default is 2)
178 178
      * @return bool TRUE if Solr can be reached, FALSE if not
179 179
      */
180 180
     public function ping($timeout = 2)
@@ -186,8 +186,8 @@  discard block
 block discarded – undo
186 186
     /**
187 187
      * Call the /admin/ping servlet, can be used to get the runtime of a ping request.
188 188
      *
189
-     * @param float|int $timeout maximum time to wait for ping in seconds, -1 for unlimited (default is 2)
190
-     * @return int runtime in milliseconds
189
+     * @param integer $timeout maximum time to wait for ping in seconds, -1 for unlimited (default is 2)
190
+     * @return double runtime in milliseconds
191 191
      * @throws \ApacheSolrForTypo3\Solr\PingFailedException
192 192
      */
193 193
     public function getPingRoundTripRuntime($timeout = 2)
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
      * a complete and well formed "delete" xml document
582 582
      *
583 583
      * @param string $rawPost Expected to be utf-8 encoded xml document
584
-     * @param float|int $timeout Maximum expected duration of the delete operation on the server (otherwise, will throw a communication exception)
584
+     * @param integer $timeout Maximum expected duration of the delete operation on the server (otherwise, will throw a communication exception)
585 585
      * @return \Apache_Solr_Response
586 586
      */
587 587
     public function delete($rawPost, $timeout = 3600)
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
     /**
679 679
      * Add list of synonyms for base word to managed synonyms map
680 680
      *
681
-     * @param $baseWord
681
+     * @param string $baseWord
682 682
      * @param array $synonyms
683 683
      *
684 684
      * @return \Apache_Solr_Response
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
     /**
700 700
      * Remove a synonym from the synonyms map
701 701
      *
702
-     * @param $baseWord
702
+     * @param string $baseWord
703 703
      * @return \Apache_Solr_Response
704 704
      * @throws \Apache_Solr_InvalidArgumentException
705 705
      */
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
715 715
     /**
716 716
      * Central method for making a HTTP DELETE operation against the Solr server
717 717
      *
718
-     * @param $url
718
+     * @param string $url
719 719
      * @param bool|float $timeout Read timeout in seconds
720 720
      * @return \Apache_Solr_Response
721 721
      */
Please login to merge, or discard this patch.
Classes/Util.php 1 patch
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
      * @param int $pageId Id of the (root) page to get the Solr configuration from.
237 237
      * @param string $path The TypoScript configuration path to retrieve.
238 238
      * @param bool $initializeTsfe Optionally initializes a full TSFE to get the configuration, defaults to FALSE
239
-     * @param int|bool $language System language uid or FALSE to disable language usage, optional, defaults to 0
239
+     * @param integer $language System language uid or FALSE to disable language usage, optional, defaults to 0
240 240
      * @return TypoScriptConfiguration The Solr configuration for the requested tree.
241 241
      */
242 242
     public static function getConfigurationFromPageId(
@@ -311,9 +311,9 @@  discard block
 block discarded – undo
311 311
 
312 312
     /**
313 313
      * This function is used to retrieve the configuration from an existing TSFE instance
314
-     * @param $pageId
315
-     * @param $path
316
-     * @param $language
314
+     * @param integer $pageId
315
+     * @param string $path
316
+     * @param integer $language
317 317
      * @return mixed
318 318
      */
319 319
     private static function getConfigurationFromExistingTSFE($pageId, $path, $language)
Please login to merge, or discard this patch.
Classes/Search.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -526,7 +526,7 @@
 block discarded – undo
526 526
             $spellcheckingSuggestions = $suggestions;
527 527
 
528 528
             if (isset($this->response->spellcheck->collations)) {
529
-                $collections = (array) $this->response->spellcheck->collations;
529
+                $collections = (array)$this->response->spellcheck->collations;
530 530
                 $spellcheckingSuggestions['collation'] = $collections['collation'];
531 531
             }
532 532
         }
Please login to merge, or discard this patch.
Classes/Domain/Search/ResultSet/SearchResultSetService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
      * @param Query $query The query that has been searched for.
287 287
      * @param \Apache_Solr_Response $response The search's response.
288 288
      */
289
-    protected function processResponse($rawQuery, Query $query, \Apache_Solr_Response &$response)
289
+    protected function processResponse($rawQuery, Query $query, \Apache_Solr_Response & $response)
290 290
     {
291 291
         if ($this->shouldHideResultsFromInitialSearch($rawQuery)) {
292 292
             // explicitly set number of results to 0 as we just wanted
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
      *
315 315
      * @param \Apache_Solr_Response $response
316 316
      */
317
-    protected function addExpandedDocumentsFromVariants(\Apache_Solr_Response &$response)
317
+    protected function addExpandedDocumentsFromVariants(\Apache_Solr_Response & $response)
318 318
     {
319 319
         if (!is_array($response->response->docs)) {
320 320
             return;
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
      * @param \Apache_Solr_Response $response
367 367
      * @throws \InvalidArgumentException
368 368
      */
369
-    protected function wrapResultDocumentInResultObject(\Apache_Solr_Response &$response)
369
+    protected function wrapResultDocumentInResultObject(\Apache_Solr_Response & $response)
370 370
     {
371 371
         if (!is_array($response->response->docs)) {
372 372
             return;
Please login to merge, or discard this patch.