Passed
Push — master ( d68dcd...b24d1f )
by Anthony
14:25
created

PageController::editPage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
namespace PiouPiou\RibsAdminBundle\Controller;
4
5
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
6
use Symfony\Component\Routing\Annotation\Route;
7
use Symfony\Component\HttpFoundation\Response;
8
9
class PageController extends AbstractController
10
{
11
    /**
12
     * @Route("/contents", name="ribsadmin_contents")
13
     * @return Response
14
     */
15
    public function index(): Response
16
    {
17
        $navigation = $this->getDoctrine()->getManager()->getRepository("RibsAdminBundle:Navigation")->findAllNavigationPage();
0 ignored issues
show
Bug introduced by
The method findAllNavigationPage() does not exist on Doctrine\Persistence\ObjectRepository. Did you maybe mean findAll()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

17
        $navigation = $this->getDoctrine()->getManager()->getRepository("RibsAdminBundle:Navigation")->/** @scrutinizer ignore-call */ findAllNavigationPage();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
18
19
        return $this->render('@RibsAdmin/page/index.html.twig', ["navigation" => $navigation]);
20
    }
21
22
    /**
23
     * @Route("/contents/edit-page/{page_id}", name="ribsadmin_contents_edit_page")
24
     * @param int $page_id
25
     * @return Response
26
     */
27
    public function editPage(int $page_id): Response
0 ignored issues
show
Unused Code introduced by
The parameter $page_id is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

27
    public function editPage(/** @scrutinizer ignore-unused */ int $page_id): Response

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
28
    {
29
        $navigation = $this->getDoctrine()->getManager()->getRepository("RibsAdminBundle:Navigation")->findAllNavigationPage();
30
31
        return $this->render('@RibsAdmin/page/index.html.twig', ["navigation" => $navigation]);
32
    }
33
}
34