@@ -214,6 +214,11 @@ discard block |
||
214 | 214 | $this->infoUpdated(); |
215 | 215 | } |
216 | 216 | |
217 | + /** |
|
218 | + * @param string $info |
|
219 | + * @param string $value |
|
220 | + * @param string $colored |
|
221 | + */ |
|
217 | 222 | private function setInfoColored($info, $value, $colored) { |
218 | 223 | if ($colored === '') { |
219 | 224 | return; |
@@ -257,7 +262,7 @@ discard block |
||
257 | 262 | } |
258 | 263 | |
259 | 264 | /** |
260 | - * @param $key |
|
265 | + * @param string $key |
|
261 | 266 | */ |
262 | 267 | public function keyPressed($key) { |
263 | 268 | foreach ($this->methodOnKeyPress as $method) { |
@@ -339,7 +344,7 @@ discard block |
||
339 | 344 | |
340 | 345 | |
341 | 346 | /** |
342 | - * @param $tick |
|
347 | + * @param integer $tick |
|
343 | 348 | */ |
344 | 349 | private function updateTick($tick) { |
345 | 350 | if (($this->ramTick + self::INFO_UPDATE) > $tick) { |
@@ -353,8 +358,8 @@ discard block |
||
353 | 358 | |
354 | 359 | /** |
355 | 360 | * @deprecated - verifier l'interet !? |
356 | - * @param $reason |
|
357 | - * @param $stop |
|
361 | + * @param string $reason |
|
362 | + * @param boolean $stop |
|
358 | 363 | */ |
359 | 364 | public function exception($reason, $stop) { |
360 | 365 | if (!$stop) { |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | } |
236 | 236 | |
237 | 237 | if ($color !== '') { |
238 | - $this->info[$info . 'Colored'] = '<' . $color . '>' . $value . '</' . $color . '>'; |
|
238 | + $this->info[$info.'Colored'] = '<'.$color.'>'.$value.'</'.$color.'>'; |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | return; |
347 | 347 | } |
348 | 348 | |
349 | - $this->setInfo('_memory', round((memory_get_usage() / 1024 / 1024)) . ' MB'); |
|
349 | + $this->setInfo('_memory', round((memory_get_usage() / 1024 / 1024)).' MB'); |
|
350 | 350 | $this->ramTick = $tick; |
351 | 351 | } |
352 | 352 | |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | */ |
359 | 359 | public function exception($reason, $stop) { |
360 | 360 | if (!$stop) { |
361 | - $this->output('Exception: ' . $reason); |
|
361 | + $this->output('Exception: '.$reason); |
|
362 | 362 | // TODO: feed an array of exceptions for log; |
363 | 363 | } |
364 | 364 | $this->runningService->exception($this->tickId, $reason, $stop); |
@@ -73,7 +73,7 @@ |
||
73 | 73 | |
74 | 74 | /** |
75 | 75 | * @param string $panelId |
76 | - * @param array $lines |
|
76 | + * @param string[] $lines |
|
77 | 77 | */ |
78 | 78 | public function createPanel($panelId, $lines) { |
79 | 79 | if (!is_array($lines)) { |
@@ -182,7 +182,7 @@ |
||
182 | 182 | } |
183 | 183 | } |
184 | 184 | |
185 | - $this->display->setFormat(implode("\n", $format) . "\n"); |
|
185 | + $this->display->setFormat(implode("\n", $format)."\n"); |
|
186 | 186 | $this->refreshInfo(); |
187 | 187 | $this->display->start(); |
188 | 188 | } |
@@ -364,7 +364,7 @@ |
||
364 | 364 | * @param IndexDocument $document |
365 | 365 | * |
366 | 366 | * @return |
367 | - * @throws Exception |
|
367 | + Index @throws Exception |
|
368 | 368 | */ |
369 | 369 | public function indexDocument( |
370 | 370 | IFullTextSearchPlatform $platform, IFullTextSearchProvider $provider, $document |
@@ -149,7 +149,7 @@ |
||
149 | 149 | public function indexProviderContentFromUser( |
150 | 150 | IFullTextSearchPlatform $platform, IFullTextSearchProvider $provider, $userId, $options |
151 | 151 | ) { |
152 | - $this->updateRunnerAction('generateIndex' . $provider->getName()); |
|
152 | + $this->updateRunnerAction('generateIndex'.$provider->getName()); |
|
153 | 153 | $this->updateRunnerInfoArray( |
154 | 154 | [ |
155 | 155 | 'userId' => $userId, |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | $output->write(' ', true); |
204 | 204 | } |
205 | 205 | |
206 | - $output->write($line . ' ', false); |
|
206 | + $output->write($line.' ', false); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | $this->output($output, 'Testing mocked provider: get indexable documents.'); |
254 | 254 | $indexableDocuments = |
255 | 255 | $testProvider->generateIndexableDocuments(TestService::DOCUMENT_USER1); |
256 | - $this->output($output, '(' . sizeof($indexableDocuments) . ' items)', false); |
|
256 | + $this->output($output, '('.sizeof($indexableDocuments).' items)', false); |
|
257 | 257 | $this->output($output, true); |
258 | 258 | } |
259 | 259 | |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | private function testLoadingPlatform($output) { |
268 | 268 | $this->output($output, 'Loading search platform.'); |
269 | 269 | $testPlatform = $this->platformService->getPlatform(); |
270 | - $this->output($output, '(' . $testPlatform->getName() . ')', false); |
|
270 | + $this->output($output, '('.$testPlatform->getName().')', false); |
|
271 | 271 | $this->output($output, true); |
272 | 272 | |
273 | 273 | $this->output($output, 'Testing search platform.'); |
@@ -357,13 +357,13 @@ discard block |
||
357 | 357 | ); |
358 | 358 | |
359 | 359 | $this->output( |
360 | - $output, '(size: ' . $indexDocument->getContentSize() . ')', false |
|
360 | + $output, '(size: '.$indexDocument->getContentSize().')', false |
|
361 | 361 | ); |
362 | 362 | $this->output($output, true); |
363 | 363 | } catch (Exception $e) { |
364 | 364 | throw new Exception( |
365 | - "Issue while getting test document '" . TestService::DOCUMENT_TYPE_LICENSE |
|
366 | - . "' from search platform: " . $e->getMessage() |
|
365 | + "Issue while getting test document '".TestService::DOCUMENT_TYPE_LICENSE |
|
366 | + . "' from search platform: ".$e->getMessage() |
|
367 | 367 | ); |
368 | 368 | } |
369 | 369 | |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | ) { |
537 | 537 | $this->output( |
538 | 538 | $output, |
539 | - " - '" . $search . "'" . (($moreOutput === '') ? '' : ' - ' . $moreOutput . ' - ') |
|
539 | + " - '".$search."'".(($moreOutput === '') ? '' : ' - '.$moreOutput.' - ') |
|
540 | 540 | ); |
541 | 541 | $request = new SearchRequest(); |
542 | 542 | |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | $searchResult = $testPlatform->searchDocuments($testProvider, $access, $request); |
545 | 545 | $this->output( |
546 | 546 | $output, |
547 | - '(result: ' . $searchResult->getCount() . ', expected: ' . json_encode($expected) . ')', |
|
547 | + '(result: '.$searchResult->getCount().', expected: '.json_encode($expected).')', |
|
548 | 548 | false |
549 | 549 | ); |
550 | 550 | $this->compareSearchResult($searchResult, $expected); |
@@ -608,12 +608,12 @@ discard block |
||
608 | 608 | private function compareSearchResult(SearchResult $searchResult, $entries) { |
609 | 609 | $documents = $searchResult->getDocuments(); |
610 | 610 | if (sizeof($documents) !== sizeof($entries)) { |
611 | - throw new \Exception('Unexpected SearchResult: ' . json_encode($searchResult)); |
|
611 | + throw new \Exception('Unexpected SearchResult: '.json_encode($searchResult)); |
|
612 | 612 | } |
613 | 613 | |
614 | 614 | foreach ($documents as $document) { |
615 | 615 | if (!in_array($document->getId(), $entries)) { |
616 | - throw new \Exception('Unexpected Document: ' . json_encode($document)); |
|
616 | + throw new \Exception('Unexpected Document: '.json_encode($document)); |
|
617 | 617 | } |
618 | 618 | } |
619 | 619 | } |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | * @throws InterruptException |
627 | 627 | */ |
628 | 628 | private function pause(OutputInterface $output, $s) { |
629 | - $this->output($output, 'Pausing ' . $s . ' seconds'); |
|
629 | + $this->output($output, 'Pausing '.$s.' seconds'); |
|
630 | 630 | |
631 | 631 | for ($i = 1; $i <= $s; $i++) { |
632 | 632 | if (time_nanosleep(1, 0) !== true) { |
@@ -448,7 +448,7 @@ |
||
448 | 448 | $index = $error['index']; |
449 | 449 | $errorIndex = ''; |
450 | 450 | if ($index !== null) { |
451 | - $errorIndex = $index->getProviderId() . ':' . $index->getDocumentId(); |
|
451 | + $errorIndex = $index->getProviderId().':'.$index->getDocumentId(); |
|
452 | 452 | } |
453 | 453 | |
454 | 454 | $this->runner->setInfoArray( |
@@ -181,8 +181,8 @@ discard block |
||
181 | 181 | */ |
182 | 182 | private function limitToDBField(IQueryBuilder &$qb, $field, $values) { |
183 | 183 | $expr = $qb->expr(); |
184 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->defaultSelectAlias . '.' : ''; |
|
185 | - $field = $pf . $field; |
|
184 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->defaultSelectAlias.'.' : ''; |
|
185 | + $field = $pf.$field; |
|
186 | 186 | |
187 | 187 | if (!is_array($values)) { |
188 | 188 | $values = [$values]; |
@@ -202,8 +202,8 @@ discard block |
||
202 | 202 | */ |
203 | 203 | protected function limitToQueuedIndexes(IQueryBuilder &$qb) { |
204 | 204 | $expr = $qb->expr(); |
205 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->defaultSelectAlias . '.' : ''; |
|
206 | - $qb->andWhere($expr->neq($pf . 'status', $qb->createNamedParameter(Index::INDEX_OK))); |
|
205 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->defaultSelectAlias.'.' : ''; |
|
206 | + $qb->andWhere($expr->neq($pf.'status', $qb->createNamedParameter(Index::INDEX_OK))); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | } |
@@ -448,7 +448,7 @@ |
||
448 | 448 | $index = $error['index']; |
449 | 449 | $errorIndex = ''; |
450 | 450 | if ($index !== null) { |
451 | - $errorIndex = $index->getProviderId() . ':' . $index->getDocumentId(); |
|
451 | + $errorIndex = $index->getProviderId().':'.$index->getDocumentId(); |
|
452 | 452 | } |
453 | 453 | |
454 | 454 | $this->runner->setInfoArray( |