Completed
Push — master ( 1c642a...c282cc )
by Steven
01:53
created

InstagramResourceOwner::getDescription()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2.5

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 4
cp 0.5
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2.5
1
<?php namespace League\OAuth2\Client\Provider;
2
3
class InstagramResourceOwner implements ResourceOwnerInterface
4
{
5
    /**
6
     * Raw response
7
     *
8
     * @var array
9
     */
10
    protected $response;
11
12
    /**
13
     * Creates new resource owner.
14
     *
15
     * @param array  $response
16
     */
17 1
    public function __construct(array $response = array())
18
    {
19 1
        $this->response = $response;
20 1
    }
21
22
    /**
23
     * Get resource owner id
24
     *
25
     * @return string|null
26
     */
27 1
    public function getId()
28
    {
29 1
        return $this->response['data']['id'] ?: null;
30
    }
31
32
    /**
33
     * Get user imageurl
34
     *
35
     * @return string|null
36
     */
37 1
    public function getImageurl()
38
    {
39 1
        return $this->response['data']['profile_picture'] ?: null;
40
    }
41
42
    /**
43
     * Get user name
44
     *
45
     * @return string|null
46
     */
47 1
    public function getName()
48
    {
49 1
        return $this->response['data']['full_name'] ?: null;
50
    }
51
52
    /**
53
     * Get user nickname
54
     *
55
     * @return string|null
56
     */
57 1
    public function getNickname()
58
    {
59 1
        return $this->response['data']['username'] ?: null;
60
    }
61
62
    /**
63
     * Get user description
64
     *
65
     * @return string|null
66
     */
67 1
    public function getDescription()
68
    {
69 1
        return $this->response['data']['bio'] ?: null;
70
    }
71
72
    /**
73
     * Return all of the owner details available as an array.
74
     *
75
     * @return array
76
     */
77 1
    public function toArray()
78
    {
79 1
        return $this->response['data'];
80
    }
81
}
82