Passed
Push — develop ( d944ff...2efefd )
by Stone
07:19 queued 10s
created

SearchTrickController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

2 Methods

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