GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

UserActionsController::listAction()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 48
Code Lines 34

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 48
rs 9.125
c 0
b 0
f 0
cc 2
eloc 34
nc 2
nop 2
1
<?php
2
3
namespace Application\Controller\MembersArea;
4
5
use Silex\Application;
6
use Symfony\Component\HttpFoundation\Request;
7
use Symfony\Component\HttpFoundation\Response;
8
9
/**
10
 * @author Borut Balažek <[email protected]>
11
 */
12
class UserActionsController
13
{
14
    /**
15
     * @param Request     $request
16
     * @param Application $app
17
     *
18
     * @return Response
19
     */
20
    public function listAction(Request $request, Application $app)
21
    {
22
        if (!$app['security']->isGranted('ROLE_ADMIN')) {
23
            $app->abort(403);
24
        }
25
26
        $limitPerPage = $request->query->get('limit_per_page', 20);
27
        $currentPage = $request->query->get('page');
28
29
        $userActionResults = $app['orm.em']
30
            ->createQueryBuilder()
31
            ->select('ua')
32
            ->from('Application\Entity\UserActionEntity', 'ua')
33
            ->leftJoin('ua.user', 'u')
34
            ->leftJoin('u.profile', 'p')
35
        ;
36
37
        $pagination = $app['application.paginator']->paginate(
38
            $userActionResults,
39
            $currentPage,
40
            $limitPerPage,
41
            array(
42
                'route' => 'members-area.user-actions',
43
                'defaultSortFieldName' => 'ua.timeCreated',
44
                'defaultSortDirection' => 'desc',
45
                'searchFields' => array(
46
                    'u.username',
47
                    'u.email',
48
                    'p.name',
49
                    'p.firstName',
50
                    'p.middleName',
51
                    'p.lastName',
52
                    'ua.key',
53
                    'ua.message',
54
                    'ua.data',
55
                ),
56
            )
57
        );
58
59
        return new Response(
60
            $app['twig']->render(
61
                'contents/members-area/user-actions/list.html.twig',
62
                array(
63
                    'pagination' => $pagination,
64
                )
65
            )
66
        );
67
    }
68
}
69