Passed
Push — main ( c2f052...4ac947 )
by Fabian
04:13 queued 01:30
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-2022 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
     * Authentication identity (e.g. username).
49
     *
50
     * @var string
51
     */
52
    protected $authcid;
53
54
    /**
55
     * Authentication secret   (e.g. password)
56
     *
57
     * @var string
58
     */
59
    protected $secret;
60
61
    /**
62
     * Authorization identity
63
     *
64
     * @var string
65
     */
66
    protected $authzid;
67
68
    /**
69
     * Service name.
70
     *
71
     * @var string
72
     */
73
    protected $service;
74
75
    /**
76
     * Service hostname.
77
     *
78
     * @var string
79
     */
80
    protected $hostname;
81
82
    /**
83
     * Constructor.
84
     *
85
     * @param string $authcid  authentication identity (e.g. username)
86
     * @param string $secret   authentication secret (e.g. password)
87
     * @param string $authzid  authorization identity (username to proxy as)
88
     * @param string $service  service name
89
     * @param string $hostname service hostname
90
     */
91 2
    public function __construct($authcid, $secret = null, $authzid = null, $service = null, $hostname = null)
92
    {
93 2
        $this->authcid  = $authcid;
94 2
        $this->secret   = $secret;
95 2
        $this->authzid  = $authzid;
96 2
        $this->service  = $service;
97 2
        $this->hostname = $hostname;
98
    }
99
100 2
    public function getAuthcid()
101
    {
102 2
        return $this->authcid;
103
    }
104
105 2
    public function getSecret()
106
    {
107 2
        return $this->secret;
108
    }
109
110 2
    public function getAuthzid()
111
    {
112 2
        return $this->authzid;
113
    }
114
115 2
    public function getService()
116
    {
117 2
        return $this->service;
118
    }
119
120 2
    public function getHostname()
121
    {
122 2
        return $this->hostname;
123
    }
124
}
125