Completed
Pull Request — master (#944)
by Timo
27:13
created
Classes/Domain/Search/Statistics/StatisticsRepository.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
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 = $this->getDatabase()->exec_SELECTgetRows(
51 51
             'keywords, count(keywords) as count, num_found as hits',
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
Classes/System/Configuration/TypoScriptConfiguration.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1561,7 +1561,7 @@
 block discarded – undo
1561 1561
      *
1562 1562
      * plugin.tx_solr.search.query.returnFields
1563 1563
      *
1564
-     * @param array $defaultIfEmpty
1564
+     * @param string[] $defaultIfEmpty
1565 1565
      * @return array
1566 1566
      */
1567 1567
     public function getSearchQueryReturnFieldsAsArray($defaultIfEmpty = [])
Please login to merge, or discard this patch.
Indentation   -4 removed lines patch added patch discarded remove patch
@@ -357,7 +357,6 @@  discard block
 block discarded – undo
357 357
      * Returns an array of all additionalPageIds by index configuration name.
358 358
      *
359 359
      * plugin.tx_solr.index.queue.pages.additionalPageIds
360
-
361 360
      * @param string $configurationName
362 361
      * @param array $defaultIfEmpty
363 362
      * @return array
@@ -916,7 +915,6 @@  discard block
 block discarded – undo
916 915
      * Returns if a log message should be written when a page was indexed.
917 916
      *
918 917
      * plugin.tx_solr.logging.indexing.pageIndexed
919
-
920 918
      * @param bool $defaultIfEmpty
921 919
      * @return bool
922 920
      */
@@ -930,7 +928,6 @@  discard block
 block discarded – undo
930 928
      * Returns if a log message should be written when the TYPO3 search markers are missing in the page.
931 929
      *
932 930
      * plugin.tx_solr.logging.indexing.missingTypo3SearchMarkers
933
-
934 931
      * @param bool $defaultIfEmpty
935 932
      * @return bool
936 933
      */
@@ -958,7 +955,6 @@  discard block
 block discarded – undo
958 955
      * Indicates if the debug mode is enabled or not.
959 956
      *
960 957
      * plugin.tx_solr.enableDebugMode
961
-
962 958
      * @param bool $defaultIfEmpty
963 959
      * @return bool
964 960
      */
Please login to merge, or discard this patch.
Classes/IndexQueue/RecordMonitor.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -338,7 +338,7 @@
 block discarded – undo
338 338
      * @param string $recordTable
339 339
      * @param integer $recordPageId
340 340
      * @param integer $recordUid
341
-     * @return mixed
341
+     * @return integer
342 342
      */
343 343
     protected function getConfigurationPageId($recordTable, $recordPageId, $recordUid)
344 344
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,6 @@
 block discarded – undo
28 28
 use ApacheSolrForTypo3\Solr\Domain\Index\Queue\RecordMonitor\Helper\MountPagesUpdater;
29 29
 use ApacheSolrForTypo3\Solr\Domain\Index\Queue\RecordMonitor\Helper\RootPageResolver;
30 30
 use ApacheSolrForTypo3\Solr\GarbageCollector;
31
-use ApacheSolrForTypo3\Solr\Site;
32 31
 use ApacheSolrForTypo3\Solr\System\TCA\TCAService;
33 32
 use ApacheSolrForTypo3\Solr\Util;
34 33
 use TYPO3\CMS\Backend\Utility\BackendUtility;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -347,7 +347,7 @@
 block discarded – undo
347 347
             return $recordPageId;
348 348
         }
349 349
 
350
-        $alternativeSiteRoots =$this->rootPageResolver->getAlternativeSiteRootPagesIds($recordTable, $recordUid, $recordPageId);
350
+        $alternativeSiteRoots = $this->rootPageResolver->getAlternativeSiteRootPagesIds($recordTable, $recordUid, $recordPageId);
351 351
 
352 352
         $lastRootPage = array_pop($alternativeSiteRoots);
353 353
         return empty($lastRootPage) ? 0 : $lastRootPage;
Please login to merge, or discard this patch.
Classes/Domain/Index/Queue/RecordMonitor/Helper/RootPageResolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
107 107
      */
108 108
     protected function getSiteRootsByObservedPageIds($table, $uid)
109 109
     {
110
-        $cacheKey = $table.'-'.$uid;
110
+        $cacheKey = $table . '-' . $uid;
111 111
         static $siteRootByObservedPageIds = [];
112 112
         if (count($siteRootByObservedPageIds[$cacheKey]) > 0) {
113 113
             return $siteRootByObservedPageIds[$cacheKey];
Please login to merge, or discard this patch.