Credential   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 0
dl 0
loc 60
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getApplicationKey() 0 4 1
A getSessionToken() 0 4 1
A getUsername() 0 4 1
A getPassword() 0 4 1
A setSessionToken() 0 4 1
A isAuthenticated() 0 4 1
1
<?php
2
/**
3
 * This file is part of the Betfair library.
4
 *
5
 * (c) Daniele D'Angeli <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace Betfair\Credential;
11
12
/**
13
 * Credentials class.
14
 *
15
 * @author Daniele D'Angeli <[email protected]>
16
 */
17
class Credential implements CredentialInterface
18
{
19
20
    private $applicationKey;
21
22
    private $sessionToken;
23
24
    protected $username;
25
26
    protected $password;
27
28
29
    /**
30
     * @param $applicationKey
31
     * @param $username
32
     * @param $password
33
     */
34
    public function __construct($applicationKey, $username, $password)
35
    {
36
        $this->applicationKey   = $applicationKey;
37
        $this->username         = $username;
38
        $this->password         = $password;
39
    }
40
41
    /**
42
     * @return string
43
     */
44
    public function getApplicationKey()
45
    {
46
        return $this->applicationKey;
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function getSessionToken()
53
    {
54
        return $this->sessionToken;
55
    }
56
57
    public function getUsername()
58
    {
59
        return $this->username;
60
    }
61
62
    public function getPassword()
63
    {
64
        return $this->password;
65
    }
66
67
    public function setSessionToken($sessionToken)
68
    {
69
        $this->sessionToken = $sessionToken;
70
    }
71
72
    public function isAuthenticated()
73
    {
74
        return $this->sessionToken !== null;
75
    }
76
}
77