HistoryController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 6
Bugs 0 Features 0
Metric Value
eloc 8
c 6
b 0
f 0
dl 0
loc 15
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 10 1
1
<?php
2
3
namespace App\Controller;
4
5
use App\Entity\Transaction;
6
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7
use Symfony\Component\Routing\Annotation\Route;
8
9
/**
10
 *
11
 * Displays previous payments the user has made.
12
 */
13
14
class HistoryController extends Controller
15
{
16
    /**
17
     * @Route("/history", name="history")
18
     */
19
    public function index()
20
    {
21
        $user = $this->getUser();
22
        $transactions = $this->getDoctrine()->getRepository(Transaction::class)->findBy(
23
            ['user_id' => $user->getUsername()],
24
            ['date' => 'DESC']
25
        );
26
        return $this->render('views/history.html.twig', [
27
            'full_name' => $user->getFullName(),
28
            'transactions' => $transactions
29
        ]);
30
    }
31
}
32