Completed
Push — master ( d128cf...cad4ab )
by Matt
08:31 queued 03:11
created

ImageController::oldImagesShowRedirect()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Controller\Image;
4
5
use App\Entity\Image;
6
use App\Repository\ImageRepository;
7
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
8
use Symfony\Component\HttpFoundation\Response;
9
use Symfony\Component\Routing\Annotation\Route;
10
11
/**
12
 * @Route("/image", name="image_")
13
 */
14
class ImageController extends AbstractController
15
{
16
    /**
17
     * @Route("/{id}", name="show", methods={"GET"})
18
     */
19
    public function show(Image $image, ImageRepository $imageRepository): Response
20
    {
21
        $prev = $imageRepository->findPrev($image);
22
        $next = $imageRepository->findNext($image);
23
        return $this->render('/image/show.html.twig', [
24
            'image' => $image,
25
            'prev' => $prev,
26
            'next' => $next
27
        ]);
28
    }
29
}
30