@@ -9,7 +9,7 @@ |
||
9 | 9 | $check->setEmail("[email protected]"); |
10 | 10 | $result = $check->validate(); |
11 | 11 | var_dump($result); |
12 | -} catch (EmailCheckerException $ex) { |
|
12 | +}catch (EmailCheckerException $ex) { |
|
13 | 13 | echo $ex->getMessage().PHP_EOL; |
14 | 14 | var_dump($ex->getDebug()); |
15 | 15 | } |
@@ -112,71 +112,71 @@ |
||
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
115 | - * Get the value of email. |
|
116 | - * |
|
117 | - * @return string |
|
118 | - */ |
|
115 | + * Get the value of email. |
|
116 | + * |
|
117 | + * @return string |
|
118 | + */ |
|
119 | 119 | public function getEmail() |
120 | 120 | { |
121 | 121 | return $this->email; |
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
125 | - * Get the value of sender. |
|
126 | - * |
|
127 | - * @return string |
|
128 | - */ |
|
125 | + * Get the value of sender. |
|
126 | + * |
|
127 | + * @return string |
|
128 | + */ |
|
129 | 129 | public function getSender() |
130 | 130 | { |
131 | 131 | return $this->sender; |
132 | 132 | } |
133 | 133 | |
134 | 134 | /** |
135 | - * Gets the Sets the stream timeout. |
|
136 | - * |
|
137 | - * @return integer |
|
138 | - */ |
|
139 | - public function getTimeout() |
|
140 | - { |
|
141 | - return $this->timeout; |
|
142 | - } |
|
143 | - |
|
144 | - /** |
|
145 | - * Sets the Sets the stream timeout. |
|
146 | - * |
|
147 | - * @param integer $timeout the timeout |
|
148 | - * |
|
149 | - * @return self |
|
150 | - */ |
|
151 | - public function setTimeout($timeout) |
|
152 | - { |
|
153 | - if (is_int($timeout)) { |
|
154 | - $this->timeout = $timeout; |
|
155 | - } |
|
135 | + * Gets the Sets the stream timeout. |
|
136 | + * |
|
137 | + * @return integer |
|
138 | + */ |
|
139 | + public function getTimeout() |
|
140 | + { |
|
141 | + return $this->timeout; |
|
142 | + } |
|
143 | + |
|
144 | + /** |
|
145 | + * Sets the Sets the stream timeout. |
|
146 | + * |
|
147 | + * @param integer $timeout the timeout |
|
148 | + * |
|
149 | + * @return self |
|
150 | + */ |
|
151 | + public function setTimeout($timeout) |
|
152 | + { |
|
153 | + if (is_int($timeout)) { |
|
154 | + $this->timeout = $timeout; |
|
155 | + } |
|
156 | 156 | return $this; |
157 | - } |
|
157 | + } |
|
158 | 158 | |
159 | 159 | /** |
160 | - * This function extract the mx record from domain |
|
161 | - * |
|
162 | - * @return sorciulus\EmailChecker\MxChecker |
|
163 | - * |
|
164 | - * @throws MxCheckerException if domain is not avaible |
|
165 | - */ |
|
160 | + * This function extract the mx record from domain |
|
161 | + * |
|
162 | + * @return sorciulus\EmailChecker\MxChecker |
|
163 | + * |
|
164 | + * @throws MxCheckerException if domain is not avaible |
|
165 | + */ |
|
166 | 166 | private function checkDomain(){ |
167 | 167 | |
168 | 168 | return new MxChecker($this->getDomain()); |
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
172 | - * This function check email is valid from SMTP command |
|
173 | - * |
|
174 | - * @param object MxChecker $recordMx |
|
175 | - * |
|
176 | - * @return object SmtpChecker |
|
177 | - * |
|
178 | - * @throws SmtpCheckerException if SMTP return error |
|
179 | - */ |
|
172 | + * This function check email is valid from SMTP command |
|
173 | + * |
|
174 | + * @param object MxChecker $recordMx |
|
175 | + * |
|
176 | + * @return object SmtpChecker |
|
177 | + * |
|
178 | + * @throws SmtpCheckerException if SMTP return error |
|
179 | + */ |
|
180 | 180 | private function checkSMTP(MxInterface $recordMx) |
181 | 181 | { |
182 | 182 | $smtp = new SmtpChecker( |
@@ -163,7 +163,7 @@ |
||
163 | 163 | * |
164 | 164 | * @throws MxCheckerException if domain is not avaible |
165 | 165 | */ |
166 | - private function checkDomain(){ |
|
166 | + private function checkDomain() { |
|
167 | 167 | |
168 | 168 | return new MxChecker($this->getDomain()); |
169 | 169 | } |
@@ -58,44 +58,44 @@ discard block |
||
58 | 58 | private $sender; |
59 | 59 | |
60 | 60 | // some smtp response codes |
61 | - const SMTP_CONNECT_SUCCESS = 220; |
|
62 | - const SMTP_QUIT_SUCCESS = 221; |
|
63 | - const SMTP_GENERIC_SUCCESS = 250; |
|
64 | - const SMTP_USER_NOT_LOCAL = 251; |
|
65 | - const SMTP_CANNOT_VRFY = 252; |
|
66 | - const SMTP_SERVICE_UNAVAILABLE = 421; |
|
67 | - // 450 Requested mail action not taken: mailbox unavailable (e.g., |
|
68 | - // mailbox busy or temporarily blocked for policy reasons) |
|
69 | - const SMTP_MAIL_ACTION_NOT_TAKEN = 450; |
|
70 | - // 451 Requested action aborted: local error in processing |
|
71 | - const SMTP_MAIL_ACTION_ABORTED = 451; |
|
72 | - // 452 Requested action not taken: insufficient system storage |
|
73 | - const SMTP_REQUESTED_ACTION_NOT_TAKEN = 452; |
|
74 | - // 500 Syntax error (may be due to a denied command) |
|
75 | - const SMTP_SYNTAX_ERROR = 500; |
|
76 | - // 502 Comment not implemented |
|
77 | - const SMTP_NOT_IMPLEMENTED = 502; |
|
78 | - // 503 Bad sequence of commands (may be due to a denied command) |
|
79 | - const SMTP_BAD_SEQUENCE = 503; |
|
80 | - // 550 Requested action not taken: mailbox unavailable (e.g., mailbox |
|
81 | - // not found, no access, or command rejected for policy reasons) |
|
82 | - const SMTP_MBOX_UNAVAILABLE = 550; |
|
83 | - const SMTP_USER_NOT_LOCAL_FORWARD = 551; |
|
84 | - // 552 Requested mail action aborted: exceeded storage allocation |
|
85 | - const SMTP_EXCEEDED_STORAGE_ALLOCAION = 552; |
|
86 | - //553 Requested action not taken: mailbox name not allowed (e.g., |
|
87 | - //mailbox syntax incorrect) |
|
88 | - const SMTP_MBOX_NAME_NOT_ALLOWED = 553; |
|
89 | - // 554 Seen this from hotmail MTAs, in response to RSET :( |
|
90 | - const SMTP_TRANSACTION_FAILED = 554; |
|
61 | + const SMTP_CONNECT_SUCCESS = 220; |
|
62 | + const SMTP_QUIT_SUCCESS = 221; |
|
63 | + const SMTP_GENERIC_SUCCESS = 250; |
|
64 | + const SMTP_USER_NOT_LOCAL = 251; |
|
65 | + const SMTP_CANNOT_VRFY = 252; |
|
66 | + const SMTP_SERVICE_UNAVAILABLE = 421; |
|
67 | + // 450 Requested mail action not taken: mailbox unavailable (e.g., |
|
68 | + // mailbox busy or temporarily blocked for policy reasons) |
|
69 | + const SMTP_MAIL_ACTION_NOT_TAKEN = 450; |
|
70 | + // 451 Requested action aborted: local error in processing |
|
71 | + const SMTP_MAIL_ACTION_ABORTED = 451; |
|
72 | + // 452 Requested action not taken: insufficient system storage |
|
73 | + const SMTP_REQUESTED_ACTION_NOT_TAKEN = 452; |
|
74 | + // 500 Syntax error (may be due to a denied command) |
|
75 | + const SMTP_SYNTAX_ERROR = 500; |
|
76 | + // 502 Comment not implemented |
|
77 | + const SMTP_NOT_IMPLEMENTED = 502; |
|
78 | + // 503 Bad sequence of commands (may be due to a denied command) |
|
79 | + const SMTP_BAD_SEQUENCE = 503; |
|
80 | + // 550 Requested action not taken: mailbox unavailable (e.g., mailbox |
|
81 | + // not found, no access, or command rejected for policy reasons) |
|
82 | + const SMTP_MBOX_UNAVAILABLE = 550; |
|
83 | + const SMTP_USER_NOT_LOCAL_FORWARD = 551; |
|
84 | + // 552 Requested mail action aborted: exceeded storage allocation |
|
85 | + const SMTP_EXCEEDED_STORAGE_ALLOCAION = 552; |
|
86 | + //553 Requested action not taken: mailbox name not allowed (e.g., |
|
87 | + //mailbox syntax incorrect) |
|
88 | + const SMTP_MBOX_NAME_NOT_ALLOWED = 553; |
|
89 | + // 554 Seen this from hotmail MTAs, in response to RSET :( |
|
90 | + const SMTP_TRANSACTION_FAILED = 554; |
|
91 | 91 | |
92 | - /** |
|
93 | - * @param array $domains List of SMTP domains |
|
94 | - * @param boolean $sender Set sender of STMP command |
|
95 | - * @param integer $timeout Timeout of the stream |
|
96 | - * |
|
97 | - * @throws SmtpCheckerException when all domain not valid |
|
98 | - */ |
|
92 | + /** |
|
93 | + * @param array $domains List of SMTP domains |
|
94 | + * @param boolean $sender Set sender of STMP command |
|
95 | + * @param integer $timeout Timeout of the stream |
|
96 | + * |
|
97 | + * @throws SmtpCheckerException when all domain not valid |
|
98 | + */ |
|
99 | 99 | function __construct(MxInterface $domains, $sender = "[email protected]", int $timeout = 10) |
100 | 100 | { |
101 | 101 | foreach ($domains->getRecordMx() as $domain) { |
@@ -119,46 +119,46 @@ discard block |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
122 | - * Sets the The sender of SMTP check email. |
|
123 | - * |
|
124 | - * @param string $sender the sender |
|
125 | - * |
|
126 | - * @return void |
|
127 | - */ |
|
128 | - private function setSender($sender) |
|
129 | - { |
|
130 | - if (!filter_var($sender, FILTER_VALIDATE_EMAIL)) { |
|
122 | + * Sets the The sender of SMTP check email. |
|
123 | + * |
|
124 | + * @param string $sender the sender |
|
125 | + * |
|
126 | + * @return void |
|
127 | + */ |
|
128 | + private function setSender($sender) |
|
129 | + { |
|
130 | + if (!filter_var($sender, FILTER_VALIDATE_EMAIL)) { |
|
131 | 131 | throw new SmtpCheckerException("Email Sender not valid"); |
132 | 132 | } |
133 | 133 | $this->sender = $sender; |
134 | 134 | |
135 | - } |
|
135 | + } |
|
136 | 136 | |
137 | 137 | /** |
138 | - * Gets the value of sender. |
|
139 | - * |
|
140 | - * @return string |
|
141 | - */ |
|
138 | + * Gets the value of sender. |
|
139 | + * |
|
140 | + * @return string |
|
141 | + */ |
|
142 | 142 | private function getSender() |
143 | 143 | { |
144 | 144 | return $this->sender; |
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
148 | - * Gets the value of domain. |
|
149 | - * |
|
150 | - * @return array |
|
151 | - */ |
|
148 | + * Gets the value of domain. |
|
149 | + * |
|
150 | + * @return array |
|
151 | + */ |
|
152 | 152 | private function getDomain() |
153 | 153 | { |
154 | 154 | return $this->domain; |
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
158 | - * Gets the value of getDomain in object. |
|
159 | - * |
|
160 | - * @return object |
|
161 | - */ |
|
158 | + * Gets the value of getDomain in object. |
|
159 | + * |
|
160 | + * @return object |
|
161 | + */ |
|
162 | 162 | private function getDomainObj() |
163 | 163 | { |
164 | 164 | return (object) $this->getDomain(); |
@@ -286,67 +286,67 @@ discard block |
||
286 | 286 | } |
287 | 287 | } |
288 | 288 | |
289 | - /** |
|
290 | - * Gets the value of code. |
|
291 | - * |
|
292 | - * @return integer |
|
293 | - */ |
|
294 | - public function getCode() |
|
295 | - { |
|
296 | - return (int) $this->code; |
|
297 | - } |
|
289 | + /** |
|
290 | + * Gets the value of code. |
|
291 | + * |
|
292 | + * @return integer |
|
293 | + */ |
|
294 | + public function getCode() |
|
295 | + { |
|
296 | + return (int) $this->code; |
|
297 | + } |
|
298 | 298 | |
299 | - /** |
|
300 | - * Gets the value of isValid. |
|
301 | - * |
|
302 | - * @return boolean |
|
303 | - */ |
|
304 | - public function isValid() |
|
305 | - { |
|
306 | - return $this->isValid; |
|
307 | - } |
|
299 | + /** |
|
300 | + * Gets the value of isValid. |
|
301 | + * |
|
302 | + * @return boolean |
|
303 | + */ |
|
304 | + public function isValid() |
|
305 | + { |
|
306 | + return $this->isValid; |
|
307 | + } |
|
308 | 308 | |
309 | - /** |
|
310 | - * Gets the value of debug. |
|
311 | - * |
|
312 | - * @return array |
|
313 | - */ |
|
314 | - public function getDebug() |
|
315 | - { |
|
316 | - return $this->debug; |
|
317 | - } |
|
309 | + /** |
|
310 | + * Gets the value of debug. |
|
311 | + * |
|
312 | + * @return array |
|
313 | + */ |
|
314 | + public function getDebug() |
|
315 | + { |
|
316 | + return $this->debug; |
|
317 | + } |
|
318 | 318 | |
319 | - /** |
|
320 | - * Gets the value of message. |
|
321 | - * |
|
322 | - * @return string |
|
323 | - */ |
|
324 | - public function getMessage() |
|
325 | - { |
|
326 | - $code = $this->getCode(); |
|
327 | - $messages = [ |
|
328 | - self::SMTP_CONNECT_SUCCESS => "SMTP connect Success", |
|
329 | - self::SMTP_QUIT_SUCCESS => "Quit Success", |
|
330 | - self::SMTP_GENERIC_SUCCESS => "SMTP Generic Success", |
|
331 | - self::SMTP_USER_NOT_LOCAL => "SMTP User not local", |
|
332 | - self::SMTP_CANNOT_VRFY => "SMTP Cannot VRFY user", |
|
333 | - self::SMTP_SERVICE_UNAVAILABLE => "SMTP Service not available", |
|
334 | - self::SMTP_MAIL_ACTION_NOT_TAKEN => "SMTP mailbox busy or temporarily blocked for policy reasons", |
|
335 | - self::SMTP_MAIL_ACTION_ABORTED => "SMTP Requested action aborted: local error in processing", |
|
336 | - self::SMTP_REQUESTED_ACTION_NOT_TAKEN => "SMTP Requested action not taken: insufficient system storage", |
|
337 | - self::SMTP_SYNTAX_ERROR => "SMTP Syntax error, command unrecognized", |
|
338 | - self::SMTP_NOT_IMPLEMENTED => "SMTP Command not implemented", |
|
339 | - self::SMTP_BAD_SEQUENCE => "SMTP Bad sequence of commands", |
|
340 | - self::SMTP_MBOX_UNAVAILABLE => "SMTP Requested action not taken: mailbox unavailable", |
|
341 | - self::SMTP_USER_NOT_LOCAL_FORWARD => "SMTP User not local", |
|
342 | - self::SMTP_EXCEEDED_STORAGE_ALLOCAION => "SMTP Requested mail action aborted: exceeded storage allocation", |
|
343 | - self::SMTP_MBOX_NAME_NOT_ALLOWED => "Requested action not taken: mailbox name not allowed", |
|
344 | - self::SMTP_TRANSACTION_FAILED => "SMTP Transaction failed" |
|
345 | - ]; |
|
319 | + /** |
|
320 | + * Gets the value of message. |
|
321 | + * |
|
322 | + * @return string |
|
323 | + */ |
|
324 | + public function getMessage() |
|
325 | + { |
|
326 | + $code = $this->getCode(); |
|
327 | + $messages = [ |
|
328 | + self::SMTP_CONNECT_SUCCESS => "SMTP connect Success", |
|
329 | + self::SMTP_QUIT_SUCCESS => "Quit Success", |
|
330 | + self::SMTP_GENERIC_SUCCESS => "SMTP Generic Success", |
|
331 | + self::SMTP_USER_NOT_LOCAL => "SMTP User not local", |
|
332 | + self::SMTP_CANNOT_VRFY => "SMTP Cannot VRFY user", |
|
333 | + self::SMTP_SERVICE_UNAVAILABLE => "SMTP Service not available", |
|
334 | + self::SMTP_MAIL_ACTION_NOT_TAKEN => "SMTP mailbox busy or temporarily blocked for policy reasons", |
|
335 | + self::SMTP_MAIL_ACTION_ABORTED => "SMTP Requested action aborted: local error in processing", |
|
336 | + self::SMTP_REQUESTED_ACTION_NOT_TAKEN => "SMTP Requested action not taken: insufficient system storage", |
|
337 | + self::SMTP_SYNTAX_ERROR => "SMTP Syntax error, command unrecognized", |
|
338 | + self::SMTP_NOT_IMPLEMENTED => "SMTP Command not implemented", |
|
339 | + self::SMTP_BAD_SEQUENCE => "SMTP Bad sequence of commands", |
|
340 | + self::SMTP_MBOX_UNAVAILABLE => "SMTP Requested action not taken: mailbox unavailable", |
|
341 | + self::SMTP_USER_NOT_LOCAL_FORWARD => "SMTP User not local", |
|
342 | + self::SMTP_EXCEEDED_STORAGE_ALLOCAION => "SMTP Requested mail action aborted: exceeded storage allocation", |
|
343 | + self::SMTP_MBOX_NAME_NOT_ALLOWED => "Requested action not taken: mailbox name not allowed", |
|
344 | + self::SMTP_TRANSACTION_FAILED => "SMTP Transaction failed" |
|
345 | + ]; |
|
346 | 346 | |
347 | - return |
|
348 | - (array_key_exists($code, $messages)) |
|
349 | - ? $messages[$code] |
|
350 | - : "Unknown message from SMTP"; |
|
351 | - } |
|
347 | + return |
|
348 | + (array_key_exists($code, $messages)) |
|
349 | + ? $messages[$code] |
|
350 | + : "Unknown message from SMTP"; |
|
351 | + } |
|
352 | 352 | } |
353 | 353 | \ No newline at end of file |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $this->client = new Telnet($domain["target"], 25, $timeout); |
105 | 105 | $this->domain = $domain; |
106 | 106 | break; |
107 | - } catch (\Exception $ex) { |
|
107 | + }catch (\Exception $ex) { |
|
108 | 108 | continue; |
109 | 109 | } |
110 | 110 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | private function sayHello() |
175 | 175 | { |
176 | 176 | $host = $this->getDomainObj()->host; |
177 | - try{ |
|
177 | + try { |
|
178 | 178 | $status = $this->commandExec(sprintf("HELO %s", $host)); |
179 | 179 | if (!in_array(self::SMTP_GENERIC_SUCCESS, $status)) { |
180 | 180 | $this->disconnect(); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | */ |
196 | 196 | private function setFrom() |
197 | 197 | { |
198 | - try{ |
|
198 | + try { |
|
199 | 199 | $status = $this->commandExec(sprintf("MAIL FROM:<%s>", $this->getSender())); |
200 | 200 | if (!in_array(self::SMTP_GENERIC_SUCCESS, $status)) { |
201 | 201 | $this->disconnect(); |
@@ -236,12 +236,12 @@ discard block |
||
236 | 236 | } |
237 | 237 | foreach ($strout as $str) { |
238 | 238 | $this->debug[] = $str; |
239 | - if(preg_match('/^[0-9]{3}/', $str, $match)) { |
|
239 | + if (preg_match('/^[0-9]{3}/', $str, $match)) { |
|
240 | 240 | $status[] = current($match); |
241 | 241 | } |
242 | 242 | } |
243 | - if(empty($status)) { |
|
244 | - throw new SmtpCheckerException("SMTP Status request Unknown, ". $output, $this->getDebug()); |
|
243 | + if (empty($status)) { |
|
244 | + throw new SmtpCheckerException("SMTP Status request Unknown, ".$output, $this->getDebug()); |
|
245 | 245 | } |
246 | 246 | return $status; |
247 | 247 | } |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | */ |
270 | 270 | public function validate($email) |
271 | 271 | { |
272 | - try{ |
|
272 | + try { |
|
273 | 273 | $command = sprintf("RCPT TO:<%s>", $email); |
274 | 274 | $exec = $this->client->exec($command); |
275 | 275 | $this->debug[] = $command; |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $this->disconnect(); |
181 | 181 | throw new SmtpCheckerException("SMTP Status unexpected: ".implode(",", $status), $this->getDebug()); |
182 | 182 | } |
183 | - }catch (\Exception $ex) { |
|
183 | + } catch (\Exception $ex) { |
|
184 | 184 | throw new SmtpCheckerException("Error Processing Request ".$ex->getMessage(), $this->getDebug()); |
185 | 185 | } |
186 | 186 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $this->disconnect(); |
202 | 202 | throw new SmtpCheckerException("SMTP Status unexpected: ".implode(",", $status), $this->getDebug()); |
203 | 203 | } |
204 | - }catch (\Exception $ex) { |
|
204 | + } catch (\Exception $ex) { |
|
205 | 205 | throw new SmtpCheckerException("Error Processing Request setFrom : ".$ex->getMessage(), $this->getDebug()); |
206 | 206 | } |
207 | 207 | |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | $this->isValid = true; |
282 | 282 | } |
283 | 283 | return $this; |
284 | - }catch (\Exception $ex) { |
|
284 | + } catch (\Exception $ex) { |
|
285 | 285 | throw new SmtpCheckerException("Error Processing Request Validate : ".$ex->getMessage(), $this->getDebug()); |
286 | 286 | } |
287 | 287 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | class MxCheckerException extends EmailCheckerException |
18 | 18 | { |
19 | 19 | public function __construct($msg, array $debug = []) |
20 | - { |
|
21 | - parent::__construct($msg, $debug); |
|
22 | - } |
|
20 | + { |
|
21 | + parent::__construct($msg, $debug); |
|
22 | + } |
|
23 | 23 | } |
24 | 24 | \ No newline at end of file |
@@ -17,21 +17,21 @@ |
||
17 | 17 | class EmailCheckerException extends \RuntimeException |
18 | 18 | { |
19 | 19 | /** |
20 | - * The debug info |
|
21 | - * @var mixed |
|
22 | - */ |
|
23 | - private $debug; |
|
20 | + * The debug info |
|
21 | + * @var mixed |
|
22 | + */ |
|
23 | + private $debug; |
|
24 | 24 | |
25 | 25 | public function __construct($msg, array $debug = []) |
26 | - { |
|
27 | - $this->debug = $debug; |
|
28 | - parent::__construct($msg); |
|
29 | - } |
|
30 | - /** |
|
31 | - * @return Debug Info |
|
32 | - */ |
|
33 | - public function getDebug() |
|
34 | - { |
|
35 | - return $this->debug; |
|
36 | - } |
|
26 | + { |
|
27 | + $this->debug = $debug; |
|
28 | + parent::__construct($msg); |
|
29 | + } |
|
30 | + /** |
|
31 | + * @return Debug Info |
|
32 | + */ |
|
33 | + public function getDebug() |
|
34 | + { |
|
35 | + return $this->debug; |
|
36 | + } |
|
37 | 37 | } |
38 | 38 | \ No newline at end of file |
@@ -17,7 +17,7 @@ |
||
17 | 17 | class SmtpCheckerException extends EmailCheckerException |
18 | 18 | { |
19 | 19 | public function __construct($msg, array $debug = []) |
20 | - { |
|
21 | - parent::__construct($msg, $debug); |
|
22 | - } |
|
20 | + { |
|
21 | + parent::__construct($msg, $debug); |
|
22 | + } |
|
23 | 23 | } |
24 | 24 | \ No newline at end of file |
@@ -47,11 +47,11 @@ |
||
47 | 47 | */ |
48 | 48 | public function getRecordMx() |
49 | 49 | { |
50 | - if(empty($this->recordMx)){ |
|
51 | - throw new MxCheckerException("Record Mx not found"); |
|
52 | - } |
|
53 | - $this->sortRecordByPriority(); |
|
54 | - return $this->recordMx; |
|
50 | + if(empty($this->recordMx)){ |
|
51 | + throw new MxCheckerException("Record Mx not found"); |
|
52 | + } |
|
53 | + $this->sortRecordByPriority(); |
|
54 | + return $this->recordMx; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -47,7 +47,7 @@ |
||
47 | 47 | */ |
48 | 48 | public function getRecordMx() |
49 | 49 | { |
50 | - if(empty($this->recordMx)){ |
|
50 | + if (empty($this->recordMx)) { |
|
51 | 51 | throw new MxCheckerException("Record Mx not found"); |
52 | 52 | } |
53 | 53 | $this->sortRecordByPriority(); |
@@ -20,144 +20,144 @@ |
||
20 | 20 | { |
21 | 21 | |
22 | 22 | /** |
23 | - * Code response from SMTP Server |
|
24 | - * @var integer |
|
25 | - */ |
|
26 | - private $code; |
|
23 | + * Code response from SMTP Server |
|
24 | + * @var integer |
|
25 | + */ |
|
26 | + private $code; |
|
27 | 27 | |
28 | - /** |
|
29 | - * Check if email is valid |
|
30 | - * @var boolean |
|
31 | - */ |
|
28 | + /** |
|
29 | + * Check if email is valid |
|
30 | + * @var boolean |
|
31 | + */ |
|
32 | 32 | private $isValid; |
33 | 33 | |
34 | - /** |
|
35 | - * Message response from SMTP Server |
|
36 | - * @var string |
|
37 | - */ |
|
34 | + /** |
|
35 | + * Message response from SMTP Server |
|
36 | + * @var string |
|
37 | + */ |
|
38 | 38 | private $message; |
39 | 39 | |
40 | - /** |
|
41 | - * instance of MxInterface |
|
42 | - * @var object |
|
43 | - */ |
|
40 | + /** |
|
41 | + * instance of MxInterface |
|
42 | + * @var object |
|
43 | + */ |
|
44 | 44 | private $recordMx; |
45 | 45 | |
46 | - /** |
|
47 | - * List SMTP Action of Library |
|
48 | - * @var array |
|
49 | - */ |
|
50 | - private $debug; |
|
46 | + /** |
|
47 | + * List SMTP Action of Library |
|
48 | + * @var array |
|
49 | + */ |
|
50 | + private $debug; |
|
51 | 51 | |
52 | - /** |
|
53 | - * Gets the value of code. |
|
54 | - * |
|
55 | - * @return integer |
|
56 | - */ |
|
57 | - public function getCode() |
|
58 | - { |
|
59 | - return $this->code; |
|
60 | - } |
|
61 | - /** |
|
62 | - * Sets the value of code. |
|
63 | - * |
|
64 | - * @param mixed $code the code |
|
65 | - * |
|
66 | - * @return self |
|
67 | - */ |
|
68 | - public function setCode($code) |
|
69 | - { |
|
70 | - $this->code = $code; |
|
52 | + /** |
|
53 | + * Gets the value of code. |
|
54 | + * |
|
55 | + * @return integer |
|
56 | + */ |
|
57 | + public function getCode() |
|
58 | + { |
|
59 | + return $this->code; |
|
60 | + } |
|
61 | + /** |
|
62 | + * Sets the value of code. |
|
63 | + * |
|
64 | + * @param mixed $code the code |
|
65 | + * |
|
66 | + * @return self |
|
67 | + */ |
|
68 | + public function setCode($code) |
|
69 | + { |
|
70 | + $this->code = $code; |
|
71 | 71 | |
72 | 72 | return $this; |
73 | - } |
|
74 | - /** |
|
75 | - * Gets the value of isValid. |
|
76 | - * |
|
77 | - * @return boolean |
|
78 | - */ |
|
79 | - public function isValid() |
|
80 | - { |
|
81 | - return $this->isValid; |
|
82 | - } |
|
83 | - /** |
|
84 | - * Sets the value of isValid. |
|
85 | - * |
|
86 | - * @param mixed $isValid the is valid |
|
87 | - * |
|
88 | - * @return self |
|
89 | - */ |
|
90 | - public function setIsValid($isValid) |
|
91 | - { |
|
92 | - $this->isValid = $isValid; |
|
73 | + } |
|
74 | + /** |
|
75 | + * Gets the value of isValid. |
|
76 | + * |
|
77 | + * @return boolean |
|
78 | + */ |
|
79 | + public function isValid() |
|
80 | + { |
|
81 | + return $this->isValid; |
|
82 | + } |
|
83 | + /** |
|
84 | + * Sets the value of isValid. |
|
85 | + * |
|
86 | + * @param mixed $isValid the is valid |
|
87 | + * |
|
88 | + * @return self |
|
89 | + */ |
|
90 | + public function setIsValid($isValid) |
|
91 | + { |
|
92 | + $this->isValid = $isValid; |
|
93 | 93 | |
94 | 94 | return $this; |
95 | - } |
|
96 | - /** |
|
97 | - * Gets the value of message. |
|
98 | - * |
|
99 | - * @return string |
|
100 | - */ |
|
101 | - public function getMessage() |
|
102 | - { |
|
103 | - return $this->message; |
|
104 | - } |
|
105 | - /** |
|
106 | - * Sets the value of message. |
|
107 | - * |
|
108 | - * @param mixed $message the message |
|
109 | - * |
|
110 | - * @return self |
|
111 | - */ |
|
112 | - public function setMessage($message) |
|
113 | - { |
|
114 | - $this->message = $message; |
|
95 | + } |
|
96 | + /** |
|
97 | + * Gets the value of message. |
|
98 | + * |
|
99 | + * @return string |
|
100 | + */ |
|
101 | + public function getMessage() |
|
102 | + { |
|
103 | + return $this->message; |
|
104 | + } |
|
105 | + /** |
|
106 | + * Sets the value of message. |
|
107 | + * |
|
108 | + * @param mixed $message the message |
|
109 | + * |
|
110 | + * @return self |
|
111 | + */ |
|
112 | + public function setMessage($message) |
|
113 | + { |
|
114 | + $this->message = $message; |
|
115 | 115 | |
116 | 116 | return $this; |
117 | - } |
|
118 | - /** |
|
119 | - * Gets the value of recordMx. |
|
120 | - * |
|
121 | - * @return MxInterface |
|
122 | - */ |
|
123 | - public function getRecordMx() |
|
124 | - { |
|
125 | - return $this->recordMx; |
|
126 | - } |
|
127 | - /** |
|
128 | - * Sets the value of recordMx. |
|
129 | - * |
|
130 | - * @param MxInterface |
|
131 | - * |
|
132 | - * @return self |
|
133 | - */ |
|
134 | - public function setRecordMx(MxInterface $recordMx) |
|
135 | - { |
|
136 | - $this->recordMx = $recordMx; |
|
117 | + } |
|
118 | + /** |
|
119 | + * Gets the value of recordMx. |
|
120 | + * |
|
121 | + * @return MxInterface |
|
122 | + */ |
|
123 | + public function getRecordMx() |
|
124 | + { |
|
125 | + return $this->recordMx; |
|
126 | + } |
|
127 | + /** |
|
128 | + * Sets the value of recordMx. |
|
129 | + * |
|
130 | + * @param MxInterface |
|
131 | + * |
|
132 | + * @return self |
|
133 | + */ |
|
134 | + public function setRecordMx(MxInterface $recordMx) |
|
135 | + { |
|
136 | + $this->recordMx = $recordMx; |
|
137 | 137 | |
138 | 138 | return $this; |
139 | - } |
|
139 | + } |
|
140 | 140 | |
141 | - /** |
|
142 | - * Gets the value of debug. |
|
143 | - * |
|
144 | - * @return mixed |
|
145 | - */ |
|
146 | - public function getDebug() |
|
147 | - { |
|
148 | - return $this->debug; |
|
149 | - } |
|
150 | - /** |
|
151 | - * Sets the value of debug. |
|
152 | - * |
|
153 | - * @param mixed $debug the debug |
|
154 | - * |
|
155 | - * @return self |
|
156 | - */ |
|
157 | - public function setDebug($debug) |
|
158 | - { |
|
159 | - $this->debug = $debug; |
|
141 | + /** |
|
142 | + * Gets the value of debug. |
|
143 | + * |
|
144 | + * @return mixed |
|
145 | + */ |
|
146 | + public function getDebug() |
|
147 | + { |
|
148 | + return $this->debug; |
|
149 | + } |
|
150 | + /** |
|
151 | + * Sets the value of debug. |
|
152 | + * |
|
153 | + * @param mixed $debug the debug |
|
154 | + * |
|
155 | + * @return self |
|
156 | + */ |
|
157 | + public function setDebug($debug) |
|
158 | + { |
|
159 | + $this->debug = $debug; |
|
160 | 160 | |
161 | - return $this; |
|
162 | - } |
|
161 | + return $this; |
|
162 | + } |
|
163 | 163 | } |
164 | 164 | \ No newline at end of file |