Completed
Push — develop ( d3d9b0...38be37 )
by
unknown
16:43
created

MailServiceOptions::setPassword()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @license MIT
7
 * @copyright  2013 - 2016 Cross Solution <http://cross-solution.de>
8
 */
9
  
10
/** */
11
namespace Core\Options;
12
13
use \Zend\Mail\Transport\SmtpOptions;
14
15
/**
16
 * ${CARET}
17
 * 
18
 * @author Carsten Bleek <[email protected]>
19
 */
20
class MailServiceOptions extends SmtpOptions
21
{
22
    /**
23
     * Local client hostname. used in the elho chalange
24
     *
25
     * @var string $name
26
     */
27
    protected $name = 'localhost';
28
29
    /**
30
     * Fully-qualified classname or short name resolvable via Zend\Mail\Protocol\SmtpLoader.
31
     * Typically, this will be one of “smtp”, “plain”, “login”, or “crammd5”, and defaults to “smtp”.
32
     *
33
     * @var string $connectionClass
34
     */
35
    protected $connectionClass = 'plain';
36
37
    /**
38
     * Mail transport. Possible Values "smtp", "sendmail". If "sendmail" is used, YAWIK will use the php mail() function
39
     * for sending mails. This requires a local MTA.
40
     * https://docs.zendframework.com/zend-mail/transport/intro/#configuration-options
41
     *
42
     * @var string $transportClass
43
     */
44
    protected $transportClass = 'smtp';
45
46
    /**
47
     * Connection configuration (passed to the underlying Protocol class)
48
     *
49
     * @var array
50
     */
51
    protected $connectionConfig = [];
52
53
    /**
54
     * Remote hostname or IP address; defaults to “127.0.0.1”.
55
     *
56
     * @var string $host
57
     */
58
    protected $host = '127.0.0.1';
59
60
    /**
61
     * @var int
62
     */
63
    protected $port = 25;
64
65
    /**
66
     * 'tls', 'ssl' or null
67
     *
68
     * @var string $ssl
69
     */
70
    protected $ssl;
71
72
    /**
73
     * @var string $username
74
     */
75
    protected $username;
76
77
    /**
78
     * @var string $password
79
     */
80
    protected $password;
81
82
83
    public function setUsername($username) {
84
        if ($username) {
85
            $this->connectionConfig['username'] = $username;
86
        }
87
        return $this;
88
    }
89
90
    public function getUsername(){
91
        return $this->connectionConfig['username'];
92
    }
93
94
    public function setPassword($password) {
95
        if ($password) {
96
            $this->connectionConfig['password'] = $password;
97
        }
98
        return $this;
99
    }
100
101
    public function getPassword(){
102
        return $this->connectionConfig['password'];
103
    }
104
105
    public function setSsl($ssl) {
106
        if ($ssl) {
107
            $this->connectionConfig['ssl'] = $ssl;
108
        }
109
        return $this;
110
    }
111
112
    public function getSsl(){
113
        return $this->connectionConfig['ssl'];
114
    }
115
116
    public function setTransportClass($transportClass) {
117
        $this->transportClass = $transportClass;
118
        return $this;
119
    }
120
121
    public function getTransportClass(){
122
        return $this->transportClass;
123
    }
124
}