Total Complexity | 7 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Coverage | 62.5% |
Changes | 3 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
28 | class DataHandlerHook |
||
29 | { |
||
30 | 2 | public function addFlushedPagesToCrawlerQueue(array $parameters, \TYPO3\CMS\Core\DataHandling\DataHandler $dataHandler): void |
|
|
|||
31 | { |
||
32 | 2 | $pageIdsToBeFlushedFromCache = $parameters['pageIdArray']; |
|
33 | 2 | if (empty($pageIdsToBeFlushedFromCache)) { |
|
34 | return; |
||
35 | } |
||
36 | 2 | foreach ($pageIdsToBeFlushedFromCache as $pageId) { |
|
37 | 2 | $pageId = (int) $pageId; |
|
38 | 2 | if ($pageId < 1) { |
|
39 | 2 | continue; |
|
40 | } |
||
41 | 2 | if ($this->getQueueRepository()->isPageInQueue($pageId)) { |
|
42 | 2 | continue; |
|
43 | } |
||
44 | 2 | $this->getCrawlerApi()->addPageToQueue($pageId); |
|
45 | } |
||
46 | 2 | } |
|
47 | |||
48 | 2 | private function getQueueRepository(): QueueRepository |
|
49 | { |
||
50 | 2 | return GeneralUtility::makeInstance(ObjectManager::class)->get(QueueRepository::class); |
|
51 | } |
||
52 | |||
53 | 2 | private function getCrawlerApi(): CrawlerApi |
|
56 | } |
||
57 | } |
||
58 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.