Credential   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getClientId() 0 4 1
A setClientId() 0 5 1
A getPassword() 0 4 1
A setPassword() 0 5 1
A toArray() 0 7 1
1
<?php
2
/**
3
 * Slince shipment tracker library
4
 * @author Tao <[email protected]>
5
 */
6
namespace Slince\ShipmentTracking\DHLECommerce;
7
8
class Credential
9
{
10
    /**
11
     * @var string
12
     */
13
    protected $clientId;
14
15
    /**
16
     * @var string
17
     */
18
    protected $password;
19
20
    public function __construct($clientId, $password)
21
    {
22
        $this->clientId = $clientId;
23
        $this->password = $password;
24
    }
25
26
    /**
27
     * @return mixed
28
     */
29
    public function getClientId()
30
    {
31
        return $this->clientId;
32
    }
33
34
    /**
35
     * @param mixed $clientId
36
     * @return Credential
37
     */
38
    public function setClientId($clientId)
39
    {
40
        $this->clientId = $clientId;
41
        return $this;
42
    }
43
44
    /**
45
     * @return mixed
46
     */
47
    public function getPassword()
48
    {
49
        return $this->password;
50
    }
51
52
    /**
53
     * @param mixed $password
54
     * @return Credential
55
     */
56
    public function setPassword($password)
57
    {
58
        $this->password = $password;
59
        return $this;
60
    }
61
62
    /**
63
     * Converts the credential to an array
64
     * @return array
65
     */
66
    public function toArray()
67
    {
68
        return [
69
            'clientId' => $this->clientId,
70
            'password' => $this->password
71
        ];
72
    }
73
}