Completed
Pull Request — master (#931)
by Timo
14:59
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/IndexQueue/Queue.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -767,7 +767,7 @@  discard block
 block discarded – undo
767 767
 
768 768
     /**
769 769
      * @param string $where
770
-     * @return mixed
770
+     * @return integer
771 771
      */
772 772
     private function getItemCount($where = '1=1')
773 773
     {
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
      * Marks an item as failed and causes the indexer to skip the item in the
889 889
      * next run.
890 890
      *
891
-     * @param int|Item $item Either the item's Index Queue
891
+     * @param Item $item Either the item's Index Queue
892 892
      *      uid or the complete item
893 893
      * @param string $errorMessage Error message
894 894
      */
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -736,7 +736,7 @@  discard block
 block discarded – undo
736 736
     {
737 737
         $indexingConfigurationConstraint = $this->buildIndexConfigurationConstraint($indexingConfigurationName);
738 738
         $where = 'root = ' . $site->getRootPageId() . $indexingConfigurationConstraint;
739
-        return (int) $this->getItemCount($where);
739
+        return (int)$this->getItemCount($where);
740 740
     }
741 741
 
742 742
     /**
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
     {
753 753
         $indexingConfigurationConstraint = $this->buildIndexConfigurationConstraint($indexingConfigurationName);
754 754
         $where = 'changed > indexed AND root = ' . $site->getRootPageId() . $indexingConfigurationConstraint;
755
-        return (int) $this->getItemCount($where);
755
+        return (int)$this->getItemCount($where);
756 756
     }
757 757
 
758 758
     /**
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
         /**  @var $db \TYPO3\CMS\Core\Database\DatabaseConnection */
775 775
         $db = $GLOBALS['TYPO3_DB'];
776 776
 
777
-        return (int) $db->exec_SELECTcountRows('uid', 'tx_solr_indexqueue_item', $where);
777
+        return (int)$db->exec_SELECTcountRows('uid', 'tx_solr_indexqueue_item', $where);
778 778
     }
779 779
 
780 780
     /**
Please login to merge, or discard this patch.
Classes/Domain/Index/IndexService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     {
78 78
         $this->site = $site;
79 79
         $this->indexQueue = is_null($queue) ? GeneralUtility::makeInstance(Queue::class) : $queue;
80
-        $this->signalSlotDispatcher = is_null($dispatcher)  ? GeneralUtility::makeInstance(Dispatcher::class) : $dispatcher;
80
+        $this->signalSlotDispatcher = is_null($dispatcher) ? GeneralUtility::makeInstance(Dispatcher::class) : $dispatcher;
81 81
     }
82 82
 
83 83
     /**
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
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];
Please login to merge, or discard this patch.