Passed
Push — master ( 786b21...4a8f5f )
by Stone
06:47 queued 42s
created

HomeController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 5 1
A __construct() 0 3 1
1
<?php
2
3
namespace App\Controller;
4
5
use App\Repository\TrickRepository;
6
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
7
use Symfony\Component\Routing\Annotation\Route;
8
9
class HomeController extends AbstractController
10
{
11
12
    /**
13
     * @var TrickRepository
14
     */
15
    private $repository;
16
17
    public function __construct(TrickRepository $repository)
18
    {
19
        $this->repository = $repository;
20
    }
21
22
    /**
23
     * @Route("/", name="home")
24
     */
25
    public function index()
26
    {
27
        $tricks = $this->repository->findLatestEdited();
28
        return $this->render('trick/index.html.twig', [
29
            'tricks' => $tricks,
30
        ]);
31
    }
32
}