JsonAuthenticationSuccessResponse   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 38
ccs 15
cts 15
cp 1
rs 10
c 0
b 0
f 0
wmc 5
lcom 1
cbo 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setUser() 0 6 1
A setProxies() 0 6 1
A setAttributes() 0 6 1
A setProxyGrantingTicket() 0 6 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: leo108
5
 * Date: 2016/10/23
6
 * Time: 15:57
7
 */
8
9
namespace Leo108\CAS\Responses;
10
11
use Leo108\CAS\Contracts\Responses\AuthenticationSuccessResponse;
12
13
class JsonAuthenticationSuccessResponse extends BaseJsonResponse implements AuthenticationSuccessResponse
14
{
15
    /**
16
     * JsonAuthenticationSuccessResponse constructor.
17
     */
18 5
    public function __construct()
19
    {
20 5
        $this->data = ['serviceResponse' => ['authenticationSuccess' => []]];
21 5
    }
22
23 1
    public function setUser($user)
24
    {
25 1
        $this->data['serviceResponse']['authenticationSuccess']['user'] = $user;
26
27 1
        return $this;
28
    }
29
30 1
    public function setProxies($proxies)
31
    {
32 1
        $this->data['serviceResponse']['authenticationSuccess']['proxies'] = $proxies;
33
34 1
        return $this;
35
    }
36
37 2
    public function setAttributes($attributes)
38
    {
39 2
        $this->data['serviceResponse']['authenticationSuccess']['attributes'] = $attributes;
40
41 2
        return $this;
42
    }
43
44 1
    public function setProxyGrantingTicket($ticket)
45
    {
46 1
        $this->data['serviceResponse']['authenticationSuccess']['proxyGrantingTicket'] = $ticket;
47
48 1
        return $this;
49
    }
50
}
51