Passed
Push — master ( 80b3fb...4e2390 )
by Anthony
01:55
created

AccessRightsController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A listAction() 0 7 1
A editAction() 0 1 1
1
<?php
2
3
namespace Ribs\RibsAdminBundle\Controller;
4
5
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6
use Symfony\Component\HttpFoundation\Response;
7
use Symfony\Component\Routing\Annotation\Route;
8
9
class AccessRightsController extends Controller
10
{
11
	/**
12
	 * @Route("/access-rights-management", name="ribsadmin_access_rights")
13
	 * @return Response
14
	 */
15
	public function listAction(): Response
16
	{
17
		$em = $this->getDoctrine()->getManager();
18
		$acces_right = $em->getRepository("RibsAdminBundle:AccessRight")->findAll();
19
		
20
		return $this->render("@RibsAdmin/access-rights/list-all-list.html.twig", [
21
			"access_right" => $acces_right
22
		]);
23
	}
24
	
25
	/**
26
	 * @Route("/access-rights-management/create/", name="ribsadmin_access_rights_create")
27
	 * @Route("/access-rights-management/edit/{guid}", name="ribsadmin_access_rights_edit")
28
	 * @return Response
29
	 */
30
	public function editAction(): Response {
31
	
32
	}
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return Symfony\Component\HttpFoundation\Response. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
33
}