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

SearchTrickController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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