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

HomeController::index()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
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
}