QqResourceOwner::getOpenId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php namespace League\OAuth2\Client\Provider;
2
3
class QqResourceOwner implements ResourceOwnerInterface
4
{
5
    /**
6
     * OpenId
7
     *
8
     * @var string
9
     */
10
    protected $openId;
11
12
    /**
13
     * Raw response
14
     *
15
     * @var array
16
     */
17
    protected $response;
18
19
    /**
20
     * Creates new resource owner.
21
     *
22
     * @param array  $response
23
     */
24
    public function __construct(array $response = array())
25
    {
26
        $this->response = $response;
27
    }
28
29
    /**
30
     * Get resource owner id
31
     *
32
     * @return string|null
33
     */
34
    public function getId()
35
    {
36
        return null;
37
    }
38
39
    /**
40
     * Get resource owner email
41
     *
42
     * @return string|null
43
     */
44
    public function getEmail()
45
    {
46
        return null;
47
    }
48
49
    /**
50
     * Get resource owner name
51
     *
52
     * @return string|null
53
     */
54
    public function getName()
55
    {
56
        return null;
57
    }
58
59
    /**
60
     * Get resource owner nickname
61
     *
62
     * @return string|null
63
     */
64
    public function getNickname()
65
    {
66
        return $this->response['nickname'] ?: null;
67
    }
68
69
    /**
70
     * Get resource owner OpenID
71
     *
72
     * @return string|null
73
     */
74
    public function getOpenId()
75
    {
76
        return $this->openId;
77
    }
78
79
    /**
80
     * Get resource owner figure url
81
     *
82
     * @return string|null
83
     */
84
    public function getFigureUrl()
85
    {
86
        return $this->response['figureurl'] ?: null;
87
    }
88
89
    /**
90
     * Set resource owner OpenID
91
     *
92
     * @param  string $openId
93
     *
94
     * @return ResourceOwner
95
     */
96
    public function setOpenId($openId)
97
    {
98
        $this->openId = $openId;
99
        $this->response['openid'] = $openId;
100
101
        return $this;
102
    }
103
104
    /**
105
     * Return all of the owner details available as an array.
106
     *
107
     * @return array
108
     */
109
    public function toArray()
110
    {
111
        return $this->response;
112
    }
113
}
114