Completed
Push — develop ( d6d5e2...840c69 )
by
unknown
03:35
created

CacheFillCommandController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fillCacheCommand() 0 8 2
1
<?php
2
3
/**
4
 * Class CacheFillCommandController
5
 */
6
7
namespace HDNET\OnpageIntegration\Command;
8
9
use TYPO3\CMS\Extbase\Mvc\Controller\CommandController;
10
11
/**
12
 * Class CacheFillCommandController
13
 */
14
class CacheFillCommandController extends CommandController
15
{
16
17
    /**
18
     * @var \HDNET\OnpageIntegration\Service\DataService
19
     * @inject
20
     */
21
    protected $dataService;
22
23
    /**
24
     * @var \HDNET\OnpageIntegration\Persister\ApiResultToCachePersister
25
     * @inject
26
     */
27
    protected $persister;
28
29
    public function fillCacheCommand()
30
    {
31
        $results = $this->dataService->getAllResults();
32
33
        foreach ($results as $key => $result) {
34
            $this->persister->persist($result, $key);
35
        }
36
    }
37
}
38