Completed
Push — master ( 3cb300...cba459 )
by Tobias
03:38
created

User::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Happyr\ApiClient\Model\UserManagement;
4
5
use Happyr\ApiClient\Model\CreatableFromArray;
6
7
/**
8
 * @author Tobias Nyholm <[email protected]>
9
 */
10
final class User implements CreatableFromArray
11
{
12
    /**
13
     * @var string
14
     */
15
    private $name;
16
17
    /**
18
     * @var string
19
     */
20
    private $email;
21
22
    /**
23
     * @param string $name
24
     * @param string $email
25
     */
26
    private function __construct($name, $email)
27
    {
28
        $this->name = $name;
29
        $this->email = $email;
30
    }
31
32
    /**
33
     * @param array $data
34
     *
35
     * @return
36
     */
37
    public static function createFromArray(array $data)
38
    {
39
        $data = $data['data'];
40
41
        return new self($data['name'], $data['email']);
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    public function getName()
48
    {
49
        return $this->name;
50
    }
51
52
    /**
53
     * @return string
54
     */
55
    public function getEmail()
56
    {
57
        return $this->email;
58
    }
59
}
60