@@ -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 | } |
@@ -122,81 +122,81 @@ |
||
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
125 | - * Get the value of email. |
|
126 | - * |
|
127 | - * @return string |
|
128 | - */ |
|
125 | + * Get the value of email. |
|
126 | + * |
|
127 | + * @return string |
|
128 | + */ |
|
129 | 129 | public function getEmail() |
130 | 130 | { |
131 | 131 | return $this->email; |
132 | 132 | } |
133 | 133 | |
134 | 134 | /** |
135 | - * Get the value of sender. |
|
136 | - * |
|
137 | - * @return string |
|
138 | - */ |
|
135 | + * Get the value of sender. |
|
136 | + * |
|
137 | + * @return string |
|
138 | + */ |
|
139 | 139 | public function getSender() |
140 | 140 | { |
141 | 141 | return $this->sender ?: "[email protected]"; |
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
145 | - * Gets the Sets the stream timeout. |
|
146 | - * |
|
147 | - * @return integer |
|
148 | - */ |
|
149 | - public function getTimeout() |
|
150 | - { |
|
151 | - return $this->timeout; |
|
152 | - } |
|
153 | - |
|
154 | - /** |
|
155 | - * Sets the Sets the stream timeout. |
|
156 | - * |
|
157 | - * @param integer $timeout the timeout |
|
158 | - * |
|
159 | - * @return self |
|
160 | - */ |
|
161 | - public function setTimeout($timeout) |
|
162 | - { |
|
163 | - if (is_int($timeout)) { |
|
164 | - $this->timeout = $timeout; |
|
165 | - } |
|
145 | + * Gets the Sets the stream timeout. |
|
146 | + * |
|
147 | + * @return integer |
|
148 | + */ |
|
149 | + public function getTimeout() |
|
150 | + { |
|
151 | + return $this->timeout; |
|
152 | + } |
|
153 | + |
|
154 | + /** |
|
155 | + * Sets the Sets the stream timeout. |
|
156 | + * |
|
157 | + * @param integer $timeout the timeout |
|
158 | + * |
|
159 | + * @return self |
|
160 | + */ |
|
161 | + public function setTimeout($timeout) |
|
162 | + { |
|
163 | + if (is_int($timeout)) { |
|
164 | + $this->timeout = $timeout; |
|
165 | + } |
|
166 | 166 | return $this; |
167 | - } |
|
168 | - |
|
169 | - /** |
|
170 | - * Gets the Disponsable Checker. |
|
171 | - * |
|
172 | - * @return EmailChecker\DisponsableChecker |
|
173 | - */ |
|
174 | - public function getDisponsableService() |
|
175 | - { |
|
176 | - return $this->disponsableService; |
|
177 | - } |
|
178 | - |
|
179 | - /** |
|
180 | - * This function extract the mx record from domain |
|
181 | - * |
|
182 | - * @return sorciulus\EmailChecker\MxChecker |
|
183 | - * |
|
184 | - * @throws MxCheckerException if domain is not avaible |
|
185 | - */ |
|
167 | + } |
|
168 | + |
|
169 | + /** |
|
170 | + * Gets the Disponsable Checker. |
|
171 | + * |
|
172 | + * @return EmailChecker\DisponsableChecker |
|
173 | + */ |
|
174 | + public function getDisponsableService() |
|
175 | + { |
|
176 | + return $this->disponsableService; |
|
177 | + } |
|
178 | + |
|
179 | + /** |
|
180 | + * This function extract the mx record from domain |
|
181 | + * |
|
182 | + * @return sorciulus\EmailChecker\MxChecker |
|
183 | + * |
|
184 | + * @throws MxCheckerException if domain is not avaible |
|
185 | + */ |
|
186 | 186 | private function checkDomain(){ |
187 | 187 | |
188 | 188 | return new MxChecker($this->getDomain()); |
189 | 189 | } |
190 | 190 | |
191 | 191 | /** |
192 | - * This function check email is valid from SMTP command |
|
193 | - * |
|
194 | - * @param object MxChecker $recordMx |
|
195 | - * |
|
196 | - * @return object SmtpChecker |
|
197 | - * |
|
198 | - * @throws SmtpCheckerException if SMTP return error |
|
199 | - */ |
|
192 | + * This function check email is valid from SMTP command |
|
193 | + * |
|
194 | + * @param object MxChecker $recordMx |
|
195 | + * |
|
196 | + * @return object SmtpChecker |
|
197 | + * |
|
198 | + * @throws SmtpCheckerException if SMTP return error |
|
199 | + */ |
|
200 | 200 | private function checkSMTP(MxInterface $recordMx) |
201 | 201 | { |
202 | 202 | $smtp = new SmtpChecker( |
@@ -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 | } |
@@ -58,44 +58,44 @@ discard block |
||
58 | 58 | private $sender = "[email protected]"; |
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 = "", int $timeout = 10) |
100 | 100 | { |
101 | 101 | foreach ($domains->getRecordMx() as $domain) { |
@@ -120,46 +120,46 @@ discard block |
||
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
123 | - * Sets the The sender of SMTP check email. |
|
124 | - * |
|
125 | - * @param string $sender the sender |
|
126 | - * |
|
127 | - * @return void |
|
128 | - */ |
|
129 | - private function setSender($sender) |
|
130 | - { |
|
131 | - if (!filter_var($sender, FILTER_VALIDATE_EMAIL)) { |
|
123 | + * Sets the The sender of SMTP check email. |
|
124 | + * |
|
125 | + * @param string $sender the sender |
|
126 | + * |
|
127 | + * @return void |
|
128 | + */ |
|
129 | + private function setSender($sender) |
|
130 | + { |
|
131 | + if (!filter_var($sender, FILTER_VALIDATE_EMAIL)) { |
|
132 | 132 | throw new SmtpCheckerException("Email Sender not valid"); |
133 | 133 | } |
134 | 134 | $this->sender = $sender; |
135 | 135 | |
136 | - } |
|
136 | + } |
|
137 | 137 | |
138 | 138 | /** |
139 | - * Gets the value of sender. |
|
140 | - * |
|
141 | - * @return string |
|
142 | - */ |
|
139 | + * Gets the value of sender. |
|
140 | + * |
|
141 | + * @return string |
|
142 | + */ |
|
143 | 143 | private function getSender() |
144 | 144 | { |
145 | 145 | return $this->sender; |
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
149 | - * Gets the value of domain. |
|
150 | - * |
|
151 | - * @return array |
|
152 | - */ |
|
149 | + * Gets the value of domain. |
|
150 | + * |
|
151 | + * @return array |
|
152 | + */ |
|
153 | 153 | private function getDomain() |
154 | 154 | { |
155 | 155 | return $this->domain; |
156 | 156 | } |
157 | 157 | |
158 | 158 | /** |
159 | - * Gets the value of getDomain in object. |
|
160 | - * |
|
161 | - * @return object |
|
162 | - */ |
|
159 | + * Gets the value of getDomain in object. |
|
160 | + * |
|
161 | + * @return object |
|
162 | + */ |
|
163 | 163 | private function getDomainObj() |
164 | 164 | { |
165 | 165 | return (object) $this->getDomain(); |
@@ -287,67 +287,67 @@ discard block |
||
287 | 287 | } |
288 | 288 | } |
289 | 289 | |
290 | - /** |
|
291 | - * Gets the value of code. |
|
292 | - * |
|
293 | - * @return integer |
|
294 | - */ |
|
295 | - public function getCode() |
|
296 | - { |
|
297 | - return (int) $this->code; |
|
298 | - } |
|
290 | + /** |
|
291 | + * Gets the value of code. |
|
292 | + * |
|
293 | + * @return integer |
|
294 | + */ |
|
295 | + public function getCode() |
|
296 | + { |
|
297 | + return (int) $this->code; |
|
298 | + } |
|
299 | 299 | |
300 | - /** |
|
301 | - * Gets the value of isValid. |
|
302 | - * |
|
303 | - * @return boolean |
|
304 | - */ |
|
305 | - public function isValid() |
|
306 | - { |
|
307 | - return $this->isValid; |
|
308 | - } |
|
300 | + /** |
|
301 | + * Gets the value of isValid. |
|
302 | + * |
|
303 | + * @return boolean |
|
304 | + */ |
|
305 | + public function isValid() |
|
306 | + { |
|
307 | + return $this->isValid; |
|
308 | + } |
|
309 | 309 | |
310 | - /** |
|
311 | - * Gets the value of debug. |
|
312 | - * |
|
313 | - * @return array |
|
314 | - */ |
|
315 | - public function getDebug() |
|
316 | - { |
|
317 | - return $this->debug; |
|
318 | - } |
|
310 | + /** |
|
311 | + * Gets the value of debug. |
|
312 | + * |
|
313 | + * @return array |
|
314 | + */ |
|
315 | + public function getDebug() |
|
316 | + { |
|
317 | + return $this->debug; |
|
318 | + } |
|
319 | 319 | |
320 | - /** |
|
321 | - * Gets the value of message. |
|
322 | - * |
|
323 | - * @return string |
|
324 | - */ |
|
325 | - public function getMessage() |
|
326 | - { |
|
327 | - $code = $this->getCode(); |
|
328 | - $messages = [ |
|
329 | - self::SMTP_CONNECT_SUCCESS => "SMTP connect Success", |
|
330 | - self::SMTP_QUIT_SUCCESS => "Quit Success", |
|
331 | - self::SMTP_GENERIC_SUCCESS => "SMTP Generic Success", |
|
332 | - self::SMTP_USER_NOT_LOCAL => "SMTP User not local", |
|
333 | - self::SMTP_CANNOT_VRFY => "SMTP Cannot VRFY user", |
|
334 | - self::SMTP_SERVICE_UNAVAILABLE => "SMTP Service not available", |
|
335 | - self::SMTP_MAIL_ACTION_NOT_TAKEN => "SMTP mailbox busy or temporarily blocked for policy reasons", |
|
336 | - self::SMTP_MAIL_ACTION_ABORTED => "SMTP Requested action aborted: local error in processing", |
|
337 | - self::SMTP_REQUESTED_ACTION_NOT_TAKEN => "SMTP Requested action not taken: insufficient system storage", |
|
338 | - self::SMTP_SYNTAX_ERROR => "SMTP Syntax error, command unrecognized", |
|
339 | - self::SMTP_NOT_IMPLEMENTED => "SMTP Command not implemented", |
|
340 | - self::SMTP_BAD_SEQUENCE => "SMTP Bad sequence of commands", |
|
341 | - self::SMTP_MBOX_UNAVAILABLE => "SMTP Requested action not taken: mailbox unavailable", |
|
342 | - self::SMTP_USER_NOT_LOCAL_FORWARD => "SMTP User not local", |
|
343 | - self::SMTP_EXCEEDED_STORAGE_ALLOCAION => "SMTP Requested mail action aborted: exceeded storage allocation", |
|
344 | - self::SMTP_MBOX_NAME_NOT_ALLOWED => "Requested action not taken: mailbox name not allowed", |
|
345 | - self::SMTP_TRANSACTION_FAILED => "SMTP Transaction failed" |
|
346 | - ]; |
|
320 | + /** |
|
321 | + * Gets the value of message. |
|
322 | + * |
|
323 | + * @return string |
|
324 | + */ |
|
325 | + public function getMessage() |
|
326 | + { |
|
327 | + $code = $this->getCode(); |
|
328 | + $messages = [ |
|
329 | + self::SMTP_CONNECT_SUCCESS => "SMTP connect Success", |
|
330 | + self::SMTP_QUIT_SUCCESS => "Quit Success", |
|
331 | + self::SMTP_GENERIC_SUCCESS => "SMTP Generic Success", |
|
332 | + self::SMTP_USER_NOT_LOCAL => "SMTP User not local", |
|
333 | + self::SMTP_CANNOT_VRFY => "SMTP Cannot VRFY user", |
|
334 | + self::SMTP_SERVICE_UNAVAILABLE => "SMTP Service not available", |
|
335 | + self::SMTP_MAIL_ACTION_NOT_TAKEN => "SMTP mailbox busy or temporarily blocked for policy reasons", |
|
336 | + self::SMTP_MAIL_ACTION_ABORTED => "SMTP Requested action aborted: local error in processing", |
|
337 | + self::SMTP_REQUESTED_ACTION_NOT_TAKEN => "SMTP Requested action not taken: insufficient system storage", |
|
338 | + self::SMTP_SYNTAX_ERROR => "SMTP Syntax error, command unrecognized", |
|
339 | + self::SMTP_NOT_IMPLEMENTED => "SMTP Command not implemented", |
|
340 | + self::SMTP_BAD_SEQUENCE => "SMTP Bad sequence of commands", |
|
341 | + self::SMTP_MBOX_UNAVAILABLE => "SMTP Requested action not taken: mailbox unavailable", |
|
342 | + self::SMTP_USER_NOT_LOCAL_FORWARD => "SMTP User not local", |
|
343 | + self::SMTP_EXCEEDED_STORAGE_ALLOCAION => "SMTP Requested mail action aborted: exceeded storage allocation", |
|
344 | + self::SMTP_MBOX_NAME_NOT_ALLOWED => "Requested action not taken: mailbox name not allowed", |
|
345 | + self::SMTP_TRANSACTION_FAILED => "SMTP Transaction failed" |
|
346 | + ]; |
|
347 | 347 | |
348 | - return |
|
349 | - (array_key_exists($code, $messages)) |
|
350 | - ? $messages[$code] |
|
351 | - : "Unknown message from SMTP"; |
|
352 | - } |
|
348 | + return |
|
349 | + (array_key_exists($code, $messages)) |
|
350 | + ? $messages[$code] |
|
351 | + : "Unknown message from SMTP"; |
|
352 | + } |
|
353 | 353 | } |
354 | 354 | \ No newline at end of file |
@@ -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(); |
@@ -6,13 +6,13 @@ |
||
6 | 6 | |
7 | 7 | class EmailChecker extends Facade |
8 | 8 | { |
9 | - /** |
|
10 | - * Get the registered name of the component. |
|
11 | - * |
|
12 | - * @return string |
|
13 | - */ |
|
14 | - protected static function getFacadeAccessor() |
|
15 | - { |
|
16 | - return 'sorciulus\EmailChecker\EmailChecker'; |
|
17 | - } |
|
9 | + /** |
|
10 | + * Get the registered name of the component. |
|
11 | + * |
|
12 | + * @return string |
|
13 | + */ |
|
14 | + protected static function getFacadeAccessor() |
|
15 | + { |
|
16 | + return 'sorciulus\EmailChecker\EmailChecker'; |
|
17 | + } |
|
18 | 18 | } |
19 | 19 | \ No newline at end of file |
@@ -7,15 +7,15 @@ |
||
7 | 7 | |
8 | 8 | class EmailCheckerServiceProvider extends ServiceProvider |
9 | 9 | { |
10 | - /** |
|
11 | - * Register bindings in the container. |
|
12 | - * |
|
13 | - * @return void |
|
14 | - */ |
|
15 | - public function register() |
|
16 | - { |
|
17 | - $this->app->singleton(EmailChecker::class, function ($app) { |
|
18 | - return new EmailChecker(); |
|
19 | - }); |
|
20 | - } |
|
10 | + /** |
|
11 | + * Register bindings in the container. |
|
12 | + * |
|
13 | + * @return void |
|
14 | + */ |
|
15 | + public function register() |
|
16 | + { |
|
17 | + $this->app->singleton(EmailChecker::class, function ($app) { |
|
18 | + return new EmailChecker(); |
|
19 | + }); |
|
20 | + } |
|
21 | 21 | } |
22 | 22 | \ No newline at end of file |
@@ -14,7 +14,7 @@ |
||
14 | 14 | */ |
15 | 15 | public function register() |
16 | 16 | { |
17 | - $this->app->singleton(EmailChecker::class, function ($app) { |
|
17 | + $this->app->singleton(EmailChecker::class, function($app) { |
|
18 | 18 | return new EmailChecker(); |
19 | 19 | }); |
20 | 20 | } |
@@ -42,20 +42,20 @@ |
||
42 | 42 | public function __construct() |
43 | 43 | { |
44 | 44 | $this->client = new Client([ |
45 | - "base_uri" => "https://open.kickbox.io", |
|
46 | - "timeout" => 2.0, |
|
45 | + "base_uri" => "https://open.kickbox.io", |
|
46 | + "timeout" => 2.0, |
|
47 | 47 | ]); |
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
51 | - * Check if service is enabled |
|
52 | - * |
|
53 | - * @return boolean |
|
54 | - */ |
|
55 | - public function isEnable() |
|
56 | - { |
|
57 | - return $this->enable; |
|
58 | - } |
|
51 | + * Check if service is enabled |
|
52 | + * |
|
53 | + * @return boolean |
|
54 | + */ |
|
55 | + public function isEnable() |
|
56 | + { |
|
57 | + return $this->enable; |
|
58 | + } |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * Call Kickbox API and return the value |
@@ -70,14 +70,14 @@ |
||
70 | 70 | throw new DisponsableException("DisponsableChecker is disable"); |
71 | 71 | } |
72 | 72 | try { |
73 | - $response = $this->client->get("/v1/disposable/" . $domain); |
|
74 | - $body = json_decode((string)$response->getBody()); |
|
73 | + $response = $this->client->get("/v1/disposable/".$domain); |
|
74 | + $body = json_decode((string) $response->getBody()); |
|
75 | 75 | if (property_exists($body, "disposable")) { |
76 | 76 | return $body->disposable; |
77 | 77 | } else { |
78 | 78 | throw new DisponsableException("Disponsable service unknown response"); |
79 | 79 | } |
80 | - } catch (TransferException $e) { |
|
80 | + }catch (TransferException $e) { |
|
81 | 81 | throw new DisponsableException($e->getMessage()); |
82 | 82 | } |
83 | 83 |