EventsController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 5
dl 0
loc 15
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A lastAction() 0 12 1
1
<?php
2
3
namespace Skobkin\Bundle\PointToolsBundle\Controller;
4
5
use Knp\Component\Pager\PaginatorInterface;
6
use Skobkin\Bundle\PointToolsBundle\Repository\SubscriptionEventRepository;
7
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
8
use Symfony\Component\HttpFoundation\{Request, Response};
9
10
class EventsController extends AbstractController
11
{
12 2
    public function lastAction(Request $request, SubscriptionEventRepository $eventRepository, PaginatorInterface $paginator): Response
13
    {
14
        $eventsPagination = $paginator->paginate(
15 2
            $eventRepository->createLastSubscriptionEventsQuery(),
16
            $request->query->getInt('page', 1),
17 2
            20
18
        );
19 2
20 2
        return $this->render('SkobkinPointToolsBundle:Events:last.html.twig', [
21 2
            'last_events' => $eventsPagination,
22 2
        ]);
23
    }
24
}
25