Completed
Push — master ( 50beb4...8d6a23 )
by Michał
02:12
created

Twitch::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 11
Ratio 100 %

Importance

Changes 0
Metric Value
dl 11
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 2
1
<?php namespace nyx\auth\id\identities;
2
3
// Internal dependencies
4
use nyx\auth\id\protocols\oauth2;
5
6
/**
7
 * Twitch 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 View Code Duplication
class Twitch extends oauth2\Identity
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
16
{
17
    /**
18
     * {@inheritDoc}
19
     */
20
    protected static $provider = oauth2\providers\Twitch::class;
21
22
    /**
23
     * {@inheritDoc}
24
     */
25
    public function __construct(oauth2\Token $token, array $data)
26
    {
27
        $this->id          = $data['_id']          ?? null;
28
        $this->username    = $data['display_name'] ?? null;
29
        $this->email       = $data['email']        ?? null;
30
        $this->avatar      = $data['logo']         ?? null;
31
32
        $this->description = $data['bio']          ?? null;
33
34
        parent::__construct($token, $data);
35
    }
36
}
37