NodeController::editAction()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 1
eloc 4
nc 1
nop 2
1
<?php
2
namespace AppBundle\Controller;
3
4
use AppBundle\Service\NodeService;
5
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7
use Symfony\Component\HttpFoundation\Request;
8
9
class NodeController extends Controller
10
{
11
    /**
12
     * @Route("/id/{id}", name="node.view")
13
     */
14
    public function viewAction(Request $request, $id)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

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

Loading history...
15
    {
16
        $node = $this->getNodeService()->viewNode($id);
17
18
        return $this->render('node/view.html.twig', [
19
            'node' => $node,
20
        ]);
21
    }
22
23
    public function editAction(Request $request, $id)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

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

Loading history...
24
    {
25
        $node = $this->getNodeService()->viewNode($id);
26
27
        return $this->render('node/view.html.twig', [
28
            'node' => $node,
29
        ]);
30
    }
31
32
    /**
33
     * @return NodeService
34
     */
35
    private function getNodeService()
36
    {
37
        return $this->get('app.node');
38
    }
39
}
40