Completed
Push — master ( 1f9f14...016e03 )
by Illia
01:51
created

EloquaResourceOwner::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 0
1
<?php
2
3
namespace Permiakov\OAuth2\Client\Provider;
4
5
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
6
7
class EloquaResourceOwner implements ResourceOwnerInterface
8
{
9
    protected $id;
10
    protected $userName;
11
    protected $displayName;
12
    protected $firstName;
13
    protected $lastName;
14
    protected $emailAddress;
15
16
    /**
17
     * @return array
18
     */
19
    public function toArray()
20
    {
21
        return array(
22
            'id' => $this->getId(),
23
            'username' => $this->getUserName(),
24
            'displayName' => $this->getDisplayName(),
25
            'firstName' => $this->getFirstName(),
26
            'lastName' => $this->getLastName(),
27
            'emailAddress' => $this->getEmailAddress()
28
        );
29
    }
30
31
    /**
32
     * @param $params
33
     * @return $this
34
     */
35
    public function exchangeArray($params)
36
    {
37
        $this->setId($params['id']);
38
        $this->setUserName($params['username']);
39
        $this->setDisplayName($params['displayName']);
40
        $this->setFirstName($params['firstName']);
41
        $this->setLastName($params['lastName']);
42
        $this->setEmailAddress($params['emailAddress']);
43
44
        return $this;
45
    }
46
47
    /**
48
     * @return mixed
49
     */
50
    public function getId()
51
    {
52
        return $this->id;
53
    }
54
55
    /**
56
     * @param mixed $id
57
     */
58
    public function setId($id)
59
    {
60
        $this->id = $id;
61
    }
62
63
    /**
64
     * @return mixed
65
     */
66
    public function getUserName()
67
    {
68
        return $this->userName;
69
    }
70
71
    /**
72
     * @param mixed $userName
73
     */
74
    public function setUserName($userName)
75
    {
76
        $this->userName = $userName;
77
    }
78
79
    /**
80
     * @return mixed
81
     */
82
    public function getDisplayName()
83
    {
84
        return $this->displayName;
85
    }
86
87
    /**
88
     * @param mixed $displayName
89
     */
90
    public function setDisplayName($displayName)
91
    {
92
        $this->displayName = $displayName;
93
    }
94
95
    /**
96
     * @return mixed
97
     */
98
    public function getFirstName()
99
    {
100
        return $this->firstName;
101
    }
102
103
    /**
104
     * @param mixed $firstName
105
     */
106
    public function setFirstName($firstName)
107
    {
108
        $this->firstName = $firstName;
109
    }
110
111
    /**
112
     * @return mixed
113
     */
114
    public function getLastName()
115
    {
116
        return $this->lastName;
117
    }
118
119
    /**
120
     * @param mixed $lastName
121
     */
122
    public function setLastName($lastName)
123
    {
124
        $this->lastName = $lastName;
125
    }
126
127
    /**
128
     * @return mixed
129
     */
130
    public function getEmailAddress()
131
    {
132
        return $this->emailAddress;
133
    }
134
135
    /**
136
     * @param mixed $emailAddress
137
     */
138
    public function setEmailAddress($emailAddress)
139
    {
140
        $this->emailAddress = $emailAddress;
141
    }
142
}
143