Completed
Pull Request — master (#9)
by Asmir
163:43 queued 133:54
created

Security   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 77
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 77
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getPassword() 0 4 1
A setPassword() 0 5 1
A isPasswordDigest() 0 4 1
A isPasswordPlain() 0 4 1
A getUsername() 0 4 1
A setUsername() 0 4 1
1
<?php
2
3
namespace GoetasWebservices\SoapServices\SoapClient\WssWsSecurity;
4
5
class Security
6
{
7
    /**
8
     * (UT 3.1) Password type: plain text.
9
     */
10
    const PASSWORD_TYPE_TEXT = 0;
11
12
    /**
13
     * (UT 3.1) Password type: digest.
14
     */
15
    const PASSWORD_TYPE_DIGEST = 1;
16
17
    /**
18
     * (UT 3.1) Password.
19
     *
20
     * @var string
21
     */
22
    protected $password;
23
24
    /**
25
     * (UT 3.1) Password type: text or digest.
26
     *
27
     * @var int
28
     */
29
    protected $passwordType = self::PASSWORD_TYPE_DIGEST;
30
31
    /**
32
     * (UT 3.1) Username.
33
     *
34
     * @var string
35
     */
36
    protected $username;
37
38
    /**
39
     * @return string
40
     */
41
    public function getPassword()
42
    {
43
        return $this->password;
44
    }
45
46
    /**
47
     * @param string $password
48
     * @param int $passwordType
49
     */
50
    public function setPassword($password, $passwordType = self::PASSWORD_TYPE_DIGEST)
51
    {
52
        $this->password = $password;
53
        $this->passwordType = $passwordType;
54
    }
55
56
    public function isPasswordDigest()
57
    {
58
        return $this->passwordType === self::PASSWORD_TYPE_DIGEST;
59
    }
60
61
    public function isPasswordPlain()
62
    {
63
        return $this->passwordType === self::PASSWORD_TYPE_TEXT;
64
    }
65
66
    /**
67
     * @return string
68
     */
69
    public function getUsername()
70
    {
71
        return $this->username;
72
    }
73
74
    /**
75
     * @param string $username
76
     */
77
    public function setUsername($username)
78
    {
79
        $this->username = $username;
80
    }
81
}
82