Bitbucket   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 40
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 14 1
1
<?php namespace nyx\auth\id\identities;
2
3
// Internal dependencies
4
use nyx\auth\id\protocols\oauth2;
5
6
/**
7
 * Bitbucket Identity
8
 *
9
 * @package     Nyx\Auth
10
 * @version     0.1.0
11
 * @author      Michal Chojnacki <[email protected]>
12
 * @copyright   2012-2017 Nyx Dev Team
13
 * @link        https://github.com/unyx/nyx
14
 */
15
class Bitbucket extends oauth2\Identity
16
{
17
    /**
18
     * {@inheritDoc}
19
     */
20
    protected static $provider = oauth2\providers\Bitbucket::class;
21
22
    /**
23
     * @var string  The location bound to the Identity.
24
     */
25
    protected $location;
26
27
    /**
28
     * @var string  The website URL bound to the Identity.
29
     */
30
    protected $website;
31
32
    /**
33
     * @var string  The time the Identity was created at.
34
     */
35
    protected $createdAt;
36
37
    /**
38
     * {@inheritDoc}
39
     */
40
    public function __construct(oauth2\Token $token, array $data)
41
    {
42
        // Note: Bitbucket's UUIDs are wrapped by curly brackets - we are not
43
        // transforming that in any way.
44
        $this->id         = $data['uuid']         ?? null;
45
        $this->username   = $data['username']     ?? null;
46
        $this->name       = $data['display_name'] ?? null;
47
        $this->email      = $data['email']        ?? null;
48
        $this->location   = $data['location']     ?? null;
49
        $this->website    = $data['website']      ?? null;
50
        $this->createdAt  = $data['created_on']   ?? null;
51
52
        parent::__construct($token, $data);
53
    }
54
}
55