Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
22 / 22
100.00% covered (success)
100.00%
13 / 13
CRAP
100.00% covered (success)
100.00%
1 / 1
AbstractClient
100.00% covered (success)
100.00%
22 / 22
100.00% covered (success)
100.00%
13 / 13
14
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
2
 getHost
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getPort
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getService
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getUsername
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getPassword
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getFolder
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setHost
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 setPort
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 setService
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 setUsername
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 setPassword
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 setFolder
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3 * Pop PHP Framework (http://www.popphp.org/)
4 *
5 * @link       https://github.com/popphp/popphp-framework
6 * @author     Nick Sagona, III <dev@nolainteractive.com>
7 * @copyright  Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com)
8 * @license    http://www.popphp.org/license     New BSD License
9 */
10
11/**
12 * @namespace
13 */
14namespace Pop\Mail\Client;
15
16/**
17 * Abstract mail client class
18 *
19 * @category   Pop
20 * @package    Pop\Mail
21 * @author     Nick Sagona, III <dev@nolainteractive.com>
22 * @copyright  Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com)
23 * @license    http://www.popphp.org/license     New BSD License
24 * @version    3.6.0
25 */
26abstract class AbstractClient implements ClientInterface
27{
28
29    /**
30     * Mail client host
31     * @var string
32     */
33    protected $host = null;
34
35    /**
36     * Mail client port
37     * @var int
38     */
39    protected $port = null;
40
41    /**
42     * Mail client service (pop, imap, nntp, etc.)
43     * @var string
44     */
45    protected $service = null;
46
47    /**
48     * Username
49     * @var string
50     */
51    protected $username = '';
52
53    /**
54     * Password
55     * @var string
56     */
57    protected $password = '';
58
59    /**
60     * Current folder
61     * @var string
62     */
63    protected $folder = '';
64
65    /**
66     * Constructor
67     *
68     * Instantiate the mail client object
69     *
70     * @param string $host
71     * @param int    $port
72     * @param string $service
73     */
74    public function __construct($host, $port, $service = null)
75    {
76        $this->setHost($host);
77        $this->setPort($port);
78        if (null !== $service) {
79            $this->setService($service);
80        }
81    }
82
83    /**
84     * Get mail client host
85     *
86     * @return string
87     */
88    public function getHost()
89    {
90        return $this->host;
91    }
92
93    /**
94     * Get mail client port
95     *
96     * @return int
97     */
98    public function getPort()
99    {
100        return $this->port;
101    }
102
103    /**
104     * Get mail client service
105     *
106     * @return string
107     */
108    public function getService()
109    {
110        return $this->service;
111    }
112
113    /**
114     * Get username
115     *
116     * @return string
117     */
118    public function getUsername()
119    {
120        return $this->username;
121    }
122
123    /**
124     * Get password
125     *
126     * @return string
127     */
128    public function getPassword()
129    {
130        return $this->password;
131    }
132
133    /**
134     * Get folder
135     *
136     * @return string
137     */
138    public function getFolder()
139    {
140        return $this->folder;
141    }
142
143    /**
144     * Set mail client host
145     *
146     * @param  string $host
147     * @return AbstractClient
148     */
149    public function setHost($host)
150    {
151        $this->host = $host;
152        return $this;
153    }
154
155    /**
156     * Set mail client port
157     *
158     * @param  int $port
159     * @return AbstractClient
160     */
161    public function setPort($port)
162    {
163        $this->port = $port;
164        return $this;
165    }
166
167    /**
168     * Set mail client service
169     *
170     * @param  string $service
171     * @return AbstractClient
172     */
173    public function setService($service)
174    {
175        $this->service = $service;
176        return $this;
177    }
178
179    /**
180     * Set username
181     *
182     * @param  string $username
183     * @return AbstractClient
184     */
185    public function setUsername($username)
186    {
187        $this->username = $username;
188        return $this;
189    }
190
191    /**
192     * Set password
193     *
194     * @param  string $password
195     * @return AbstractClient
196     */
197    public function setPassword($password)
198    {
199        $this->password = $password;
200        return $this;
201    }
202
203    /**
204     * Set folder
205     *
206     * @param  string $folder
207     * @return AbstractClient
208     */
209    public function setFolder($folder)
210    {
211        $this->folder = $folder;
212        return $this;
213    }
214
215}