PostController::showAction()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Skobkin\Bundle\PointToolsBundle\Controller;
4
5
use Skobkin\Bundle\PointToolsBundle\Entity\Blogs\Post;
6
use Skobkin\Bundle\PointToolsBundle\Repository\Blogs\PostRepository;
7
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
8
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
9
use Symfony\Component\HttpFoundation\Response;
10
11
class PostController extends AbstractController
12
{
13
    /**
14
     * @ParamConverter("post", class="SkobkinPointToolsBundle:Blogs\Post")
15
     *
16
     * @return Response
17 1
     */
18
    public function showAction(Post $post, PostRepository $postRepository): Response
19 1
    {
20 1
        return $this->render('SkobkinPointToolsBundle:Post:show.html.twig', [
21
            'post' => $postRepository->getPostWithComments($post->getId()),
22
        ]);
23
    }
24
25
}
26