Completed
Pull Request — master (#10)
by
unknown
02:57
created

SlackAuthorizedUser::getTeam()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 2
eloc 2
nc 2
nop 0
crap 6
1
<?php
2
3
4
namespace AdamPaterson\OAuth2\Client\Provider;
5
6
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
7
8
class SlackAuthorizedUser implements ResourceOwnerInterface
9
{
10
    protected $response;
11
12
    /**
13
     * SlackAuthorizedUser constructor.
14
     *
15
     * @param $response
16
     */
17
    public function __construct(array $response)
18
    {
19
        $this->response = $response;
20
    }
21
22
    /**
23
     * Returns the identifier of the authorized resource owner.
24
     *
25
     * @return mixed
26
     */
27
    public function getId()
28
    {
29
        return $this->response['user_id'];
30
    }
31
32
    /**
33
     * Return all of the owner details available as an array.
34
     *
35
     * @return array
36
     */
37
    public function toArray()
38
    {
39
        return $this->response;
40
    }
41
42
    public function getUrl()
43
    {
44
        return $this->response['url'] ?: null;
45
    }
46
47
    public function getTeam()
48
    {
49
        return $this->response['team'] ?: null;
50
    }
51
52
    public function getUser()
53
    {
54
        return $this->response['user'] ?: null;
55
    }
56
57
    public function getTeamId()
58
    {
59
        return $this->response['team_id'] ?: null;
60
    }
61
62
    public function getUserId()
63
    {
64
        return $this->response['user_id'] ?: null;
65
    }
66
}
67