Passed
Push — develop ( 046a3b...2fdc71 )
by Fabian
02:29
created

Options::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
nc 1
nop 5
dl 0
loc 7
ccs 6
cts 6
cp 1
crap 1
rs 10
c 1
b 0
f 0
1
<?php
2
3
/**
4
 * Sasl library.
5
 *
6
 * Copyright (c) 2002-2003 Richard Heyes,
7
 *               2014-2021 Fabian Grutschus
8
 * All rights reserved.
9
 *
10
 * Redistribution and use in source and binary forms, with or without
11
 * modification, are permitted provided that the following conditions
12
 * are met:
13
 *
14
 * o Redistributions of source code must retain the above copyright
15
 *   notice, this list of conditions and the following disclaimer.
16
 * o Redistributions in binary form must reproduce the above copyright
17
 *   notice, this list of conditions and the following disclaimer in the
18
 *   documentation and/or other materials provided with the distribution.|
19
 * o The names of the authors may not be used to endorse or promote
20
 *   products derived from this software without specific prior written
21
 *   permission.
22
 *
23
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
 *
35
 * @author Fabian Grutschus <[email protected]>
36
 */
37
38
namespace Fabiang\Sasl;
39
40
/**
41
 * Options object for Sasl.
42
 *
43
 * @author Fabian Grutschus <[email protected]>
44
 */
45
class Options
46
{
47
48
    /**
49
     * Authentication identity (e.g. username).
50
     *
51
     * @var string
52
     */
53
    protected $authcid;
54
55
    /**
56
     * Authentication secret   (e.g. password)
57
     *
58
     * @var string
59
     */
60
    protected $secret;
61
62
    /**
63
     * Authorization identity
64
     *
65
     * @var string
66
     */
67
    protected $authzid;
68
69
    /**
70
     * Service name.
71
     *
72
     * @var string
73
     */
74
    protected $service;
75
76
    /**
77
     * Service hostname.
78
     *
79
     * @var string
80
     */
81
    protected $hostname;
82
83
    /**
84
     * Constructor.
85
     *
86
     * @param string $authcid  authentication identity (e.g. username)
87
     * @param string $secret   authentication secret (e.g. password)
88
     * @param string $authzid  authorization identity (username to proxy as)
89
     * @param string $service  service name
90
     * @param string $hostname service hostname
91
     */
92 2
    public function __construct($authcid, $secret = null, $authzid = null, $service = null, $hostname = null)
93
    {
94 2
        $this->authcid  = $authcid;
95 2
        $this->secret   = $secret;
96 2
        $this->authzid  = $authzid;
97 2
        $this->service  = $service;
98 2
        $this->hostname = $hostname;
99
    }
100
101 2
    public function getAuthcid()
102
    {
103 2
        return $this->authcid;
104
    }
105
106 2
    public function getSecret()
107
    {
108 2
        return $this->secret;
109
    }
110
111 2
    public function getAuthzid()
112
    {
113 2
        return $this->authzid;
114
    }
115
116 2
    public function getService()
117
    {
118 2
        return $this->service;
119
    }
120
121 2
    public function getHostname()
122
    {
123 2
        return $this->hostname;
124
    }
125
}
126