Completed
Push — master ( cc74a3...da64f9 )
by Peter
14:57
created

Tenant::getServiceEndpoint()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace TreeHouse\Keystone\Client\Model;
4
5
class Tenant
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $tokenUrl;
11
12
    /**
13
     * @var string
14
     */
15
    protected $username;
16
17
    /**
18
     * @var string
19
     */
20
    protected $password;
21
22
    /**
23
     * @var string
24
     */
25
    protected $serviceType;
26
27
    /**
28
     * @var string
29
     */
30
    protected $serviceName;
31
32
    /**
33
     * @var string
34
     */
35
    protected $tenantName;
36
37
    /**
38
     * @var string
39
     */
40
    protected $serviceEndpoint;
41
42
    /**
43
     * @param string $tokenUrl        The url where to obtain a token
44
     * @param string $username        Username
45 16
     * @param string $password        Password
46
     * @param string $serviceType     The type of service
47 16
     * @param string $serviceName     Service name. If left empty, the first matching service type will be used.
48 16
     * @param string $tenantName      Tenant name (optional)
49 16
     * @param string $serviceEndpoint Service catalog endpoint (defaults to public)
50 16
     */
51 16
    public function __construct($tokenUrl, $username, $password, $serviceType, $serviceName = null, $tenantName = null, $serviceEndpoint = 'public')
52 16
    {
53 16
        $this->tokenUrl = $tokenUrl;
54
        $this->username = $username;
55
        $this->password = $password;
56
        $this->serviceType = $serviceType;
57
        $this->serviceName = $serviceName;
58 11
        $this->tenantName = $tenantName;
59
        $this->serviceEndpoint = ($serviceEndpoint !== null) ? $serviceEndpoint : 'public';
60 11
    }
61
62
    /**
63
     * @return string
64
     */
65
    public function getTokenUrl()
66 5
    {
67
        return $this->tokenUrl;
68 5
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function getUsername()
74 5
    {
75
        return $this->username;
76 5
    }
77
78
    /**
79
     * @return string
80
     */
81
    public function getPassword()
82 10
    {
83
        return $this->password;
84 10
    }
85
86
    /**
87
     * @return string
88
     */
89
    public function getServiceType()
90 10
    {
91
        return $this->serviceType;
92 10
    }
93
94
    /**
95
     * @return string
96
     */
97
    public function getServiceName()
98 5
    {
99
        return $this->serviceName;
100 5
    }
101
102
    /**
103
     * @return string
104
     */
105
    public function getTenantName()
106
    {
107
        return $this->tenantName;
108
    }
109
110
    /**
111
     * @return string
112
     */
113
    public function getServiceEndpoint()
114
    {
115
        return $this->serviceEndpoint;
116
    }
117
}
118