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.
Completed
Push — develop ( 851100...f799d7 )
by Borut
15:15
created

UserActionsController::listAction()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 49
Code Lines 35

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 49
rs 9.2258
cc 2
eloc 35
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['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.type',
53
                    'ua.key',
54
                    'ua.message',
55
                    'ua.data',
56
                ),
57
            )
58
        );
59
60
        return new Response(
61
            $app['twig']->render(
62
                'contents/members-area/user-actions/list.html.twig',
63
                array(
64
                    'pagination' => $pagination,
65
                )
66
            )
67
        );
68
    }
69
}
70