Passed
Push — master ( 87bc65...75b6f5 )
by Julito
10:39
created

UserController::profileAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CoreBundle\Controller;
5
6
use Chamilo\CoreBundle\Controller\BaseController;
7
use Chamilo\CoreBundle\Entity\CourseRelUser;
8
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
9
use Symfony\Component\HttpFoundation\JsonResponse;
10
use Symfony\Component\HttpFoundation\Request;
11
use Symfony\Component\HttpFoundation\Response;
12
use Symfony\Component\Routing\Annotation\Route;
13
14
/**
15
 * Class UserController.
16
 *
17
 * @Route("/user")
18
 *
19
 * @author Julio Montoya <[email protected]>
20
 */
21
class UserController extends BaseController
22
{
23
    /**
24
     * @Route("/{username}", methods={"GET"})
25
     *
26
     * @param string $username
27
     *
28
     * @Template("ChamiloCoreBundle:User:profile.html.twig")
29
     *
30
     * @return Response
31
     */
32
    public function profileAction($username): array
33
    {
34
        $user = $this->container->get('fos_user.user_manager')->findUserByUsername($username);
35
36
        return ['user' => $user];
0 ignored issues
show
Bug Best Practice introduced by
The expression return array('user' => $user) returns the type array which is incompatible with the documented return type Symfony\Component\HttpFoundation\Response.
Loading history...
37
    }
38
}
39