Completed
Push — master ( 62a450...2faef5 )
by
unknown
12s
created

IndexController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A indexAction() 0 4 1
1
<?php
2
3
namespace SumoCoders\FrameworkUserBundle\Controller;
4
5
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
7
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
8
use SumoCoders\FrameworkMultiUserBundle\User\AbstractUserRepository;
9
10
/**
11
 * @Route(service="sumo_coders.user.controller.index")
12
 */
13
final class IndexController
14
{
15
    /** @var AbstractUserRepository */
16
    private $userRepository;
17
18
    public function __construct(AbstractUserRepository $userRepository)
19
    {
20
        $this->userRepository = $userRepository;
21
    }
22
23
    /**
24
     * @Route("/user")
25
     * @Security("has_role('ROLE_ADMIN')")
26
     * @Template()
27
     *
28
     * @return array
29
     */
30
    public function indexAction(): array
31
    {
32
        return ['users' => $this->userRepository->findBy([], ['username' => 'ASC'])];
33
    }
34
}
35