setProxyGrantingTicket()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 6
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
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