HubicController   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 38
ccs 0
cts 16
cp 0
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A listAction() 0 9 2
A injectAccountRepository() 0 4 1
A injectHubicService() 0 4 1
1
<?php
2
3
namespace Filoucrackeur\Hubic\Controller;
4
5
use Filoucrackeur\Hubic\Domain\Model\Account;
6
use Filoucrackeur\Hubic\Domain\Repository\AccountRepository;
7
use Filoucrackeur\Hubic\Service\HubicService;
8
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
9
10
class HubicController extends ActionController
11
{
12
    /**
13
     * @var \Filoucrackeur\Hubic\Service\HubicService
14
     */
15
    protected $hubicService;
16
17
    /**
18
     * @var \Filoucrackeur\Hubic\Domain\Repository\AccountRepository
19
     */
20
    protected $accountRepository;
21
22
    public function listAction()
23
    {
24
        /** @var Account $account */
25
        $account = $this->accountRepository->findByIdentifier($this->settings['account']);
26
        if ($account) {
27
            $this->hubicService->setAccount($account);
28
            $this->view->assign('links', $this->hubicService->getAllLinks());
29
        }
30
    }
31
32
    /**
33
     * @param AccountRepository $accountRepository
34
     */
35
    public function injectAccountRepository(AccountRepository $accountRepository)
36
    {
37
        $this->accountRepository = $accountRepository;
38
    }
39
40
    /**
41
     * @param HubicService $hubicService
42
     */
43
    public function injectHubicService(HubicService $hubicService)
44
    {
45
        $this->hubicService = $hubicService;
46
    }
47
}
48