Completed
Push — master ( f95e19...31ed8c )
by Dragos
13:13
created

ApiCredentials   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 4
c 2
b 0
f 1
lcom 0
cbo 0
dl 0
loc 67
ccs 0
cts 8
cp 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getEmail() 0 4 1
A getApiKey() 0 4 1
A getAccountHash() 0 4 1
1
<?php
2
3
namespace Speicher210\Fastbill\Api;
4
5
/**
6
 * Store the API credentials for fastbill API.
7
 *
8
 * @see Look for the account hash under hosted pages in fastbill dashboard settings.
9
 */
10
class ApiCredentials
11
{
12
    /**
13
     * The email for authentication to fastbill API.
14
     *
15
     * @var string
16
     */
17
    protected $email;
18
19
    /**
20
     * The API key for authentication to fastbill API.
21
     *
22
     * @var string
23
     */
24
    protected $apiKey;
25
26
    /**
27
     * The Fastbill account hash.
28
     *
29
     * @var string
30
     */
31
    protected $accountHash;
32
33
    /**
34
     * Constructor.
35
     *
36
     * @param string $email The email for authentication to fastbill API.
37
     * @param string $apiKey The email for authentication to fastbill API.
38
     * @param string $accountHash The Fastbill account hash.
39
     */
40
    public function __construct($email, $apiKey, $accountHash = null)
41
    {
42
        $this->email = $email;
43
        $this->apiKey = $apiKey;
44
        $this->accountHash = $accountHash;
45
    }
46
47
    /**
48
     * Get the email for authentication to fastbill API.
49
     *
50
     * @return string
51
     */
52
    public function getEmail()
53
    {
54
        return $this->email;
55
    }
56
57
    /**
58
     * Get the API key for authentication to fastbill API.
59
     *
60
     * @return string
61
     */
62
    public function getApiKey()
63
    {
64
        return $this->apiKey;
65
    }
66
67
    /**
68
     * Get the account hash.
69
     *
70
     * @return null|string
71
     */
72
    public function getAccountHash()
73
    {
74
        return $this->accountHash;
75
    }
76
}
77