BitbucketResourceOwner   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
c 1
b 0
f 1
lcom 1
cbo 0
dl 0
loc 39
ccs 7
cts 7
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getId() 0 4 2
A toArray() 0 4 1
1
<?php
2
3
namespace League\OAuth1\Client\Server;
4
5
class BitbucketResourceOwner implements ResourceOwnerInterface
6
{
7
    /**
8
     * Response data.
9
     *
10
     * @var array
11
     */
12
    protected $response;
13
14
    /**
15
     * Creates new bitbucket resource owner instance.
16
     *
17
     * @param array  $response
18
     */
19 2
    public function __construct(array $response = array())
20
    {
21 2
        $this->response = $response;
22 2
    }
23
24
    /**
25
     * Returns the identifier of the authorised resource owner.
26
     *
27
     * @return string|null
28
     */
29 2
    public function getId()
30
    {
31 2
        return $this->response['id'] ?: null;
32
    }
33
34
    /**
35
     * Returns all of the owner details available as an array.
36
     *
37
     * @return array
38
     */
39 2
    public function toArray()
40
    {
41 2
        return $this->response;
42
    }
43
}
44