Code

< 40 %
40-60 %
> 60 %
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 2
    public function __construct(array $response = array())
18
    {
19 2
        $this->response = $response;
20 2
    }
21
22
    /**
23
     * Get resource owner id
24
     *
25
     * @return string|null
26
     */
27 2
    public function getId()
28
    {
29 2
        return $this->response['id'] ?: null;
30
    }
31
32
    /**
33
     * Get user nickname
34
     *
35
     * @return string|null
36
     */
37 2
    public function getNickname()
38
    {
39 2
        return $this->response['username'] ?: null;
40
    }
41
42
    /**
43
     * Return all of the owner details available as an array.
44
     *
45
     * @return array
46
     */
47 2
    public function toArray()
48
    {
49 2
        return $this->response;
50
    }
51
}
52