Completed
Push — master ( 5bed62...18bc97 )
by Yaroslav
07:44
created

Controller::securityAdminRoleAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 *
5
 * (c) Yaroslav Honcharuk <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Yarhon\RouteGuardBundle\Tests\Functional\Bundle\SensioSecurityBundle\Controller;
12
13
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
14
use Symfony\Component\Routing\Annotation\Route;
15
use Symfony\Component\HttpFoundation\Request;
16
use Symfony\Component\HttpFoundation\Response;
17
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
18
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
19
20
/**
21
 * @author Yaroslav Honcharuk <[email protected]>
22
 */
23
class Controller extends AbstractController
24
{
25
    /**
26
     * @Route("/public", name="public")
27
     */
28
    public function publicAction()
29
    {
30
        return new Response('');
31
    }
32
33
    /**
34
     * @Route("/is_granted/user_role", name="is_granted_user_role")
35
     * @IsGranted("ROLE_USER", subject="argument")
36
     */
37
    public function isGrantedUserRoleAction($argument = 10)
0 ignored issues
show
Unused Code introduced by
The parameter $argument 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

37
    public function isGrantedUserRoleAction(/** @scrutinizer ignore-unused */ $argument = 10)

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...
38
    {
39
        return new Response('');
40
    }
41
42
    /**
43
     * @Route("/is_granted/admin_role", name="is_granted_admin_role")
44
     * @IsGranted("ROLE_ADMIN", subject="argument")
45
     */
46
    public function isGrantedAdminRoleAction($argument = 10)
0 ignored issues
show
Unused Code introduced by
The parameter $argument 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

46
    public function isGrantedAdminRoleAction(/** @scrutinizer ignore-unused */ $argument = 10)

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...
47
    {
48
        return new Response('');
49
    }
50
51
    /**
52
     * @Route("/security/user_role", name="security_user_role")
53
     * @Security("is_granted('ROLE_USER')")
54
     */
55
    public function securityUserRoleAction()
56
    {
57
        return new Response('');
58
    }
59
60
    /**
61
     * @Route("/security/admin_role", name="security_admin_role")
62
     * @Security("is_granted('ROLE_ADMIN')")
63
     */
64
    public function securityAdminRoleAction()
65
    {
66
        return new Response('');
67
    }
68
69
    /**
70
     * @Route("/security/controller_argument/{argument}", name="security_controller_argument")
71
     * @Security("argument == 10")
72
     */
73
    public function securityControllerArgumentAction($argument)
0 ignored issues
show
Unused Code introduced by
The parameter $argument 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

73
    public function securityControllerArgumentAction(/** @scrutinizer ignore-unused */ $argument)

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...
74
    {
75
        return new Response('');
76
    }
77
}
78