Passed
Pull Request — master (#9)
by Pavel
11:27
created

SecurityController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
dl 0
loc 20
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2
ccs 2
cts 4
cp 0.5
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A publicAction() 0 4 1
A privateAction() 0 4 1
1
<?php
2
3
namespace Bankiru\Api\Rpc\Test\Rpc;
4
5
use Bankiru\Api\Rpc\Routing\Annotation\Method;
6
use Bankiru\Api\Rpc\Test\Impl\Response;
7
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
8
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
9
10
/**
11
 * @Method("security/")
12
 */
13
final class SecurityController extends Controller
14
{
15
    /**
16
     * @Method("public")
17
     * @Security("is_granted('IS_AUTHENTICATED_ANONYMOUSLY')")
18
     */
19 1
    public function publicAction()
20
    {
21 1
        return new Response(['success' => true]);
22
    }
23
24
    /**
25
     * @Method("private")
26
     * @Security("is_granted('IS_AUTHENTICATED_FULLY')")
27
     */
28
    public function privateAction()
29
    {
30
        return new Response(['success' => true]);
31
    }
32
}
33