Completed
Branch proxy (978f48)
by leo
04:49
created

JsonAuthenticationSuccessResponse::toResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
ccs 0
cts 2
cp 0
crap 2
rs 10
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 4
    public function __construct()
19
    {
20 4
        $this->data = ['serviceResponse' => ['authenticationSuccess' => []]];
21 4
    }
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 1
    public function setAttributes($attributes)
38
    {
39 1
        $this->data['serviceResponse']['authenticationSuccess']['attributes'] = $attributes;
40
41 1
        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