@@ -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( |
@@ -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 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | class DisponsableException 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 |
@@ -20,172 +20,172 @@ |
||
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 | - */ |
|
32 | - private $isValid; |
|
28 | + /** |
|
29 | + * Check if email is valid |
|
30 | + * @var boolean |
|
31 | + */ |
|
32 | + private $isValid; |
|
33 | 33 | |
34 | - /** |
|
35 | - * Check if email is disponsable |
|
36 | - * @var boolean |
|
37 | - */ |
|
34 | + /** |
|
35 | + * Check if email is disponsable |
|
36 | + * @var boolean |
|
37 | + */ |
|
38 | 38 | private $isDisponsable; |
39 | 39 | |
40 | - /** |
|
41 | - * Message response from SMTP Server |
|
42 | - * @var string |
|
43 | - */ |
|
40 | + /** |
|
41 | + * Message response from SMTP Server |
|
42 | + * @var string |
|
43 | + */ |
|
44 | 44 | private $message; |
45 | 45 | |
46 | - /** |
|
47 | - * instance of MxInterface |
|
48 | - * @var object |
|
49 | - */ |
|
46 | + /** |
|
47 | + * instance of MxInterface |
|
48 | + * @var object |
|
49 | + */ |
|
50 | 50 | private $recordMx; |
51 | 51 | |
52 | - /** |
|
53 | - * List SMTP Action of Library |
|
54 | - * @var array |
|
55 | - */ |
|
56 | - private $debug; |
|
52 | + /** |
|
53 | + * List SMTP Action of Library |
|
54 | + * @var array |
|
55 | + */ |
|
56 | + private $debug; |
|
57 | 57 | |
58 | - /** |
|
59 | - * Gets the value of code. |
|
60 | - * |
|
61 | - * @return integer |
|
62 | - */ |
|
63 | - public function getCode() |
|
64 | - { |
|
65 | - return $this->code; |
|
66 | - } |
|
67 | - /** |
|
68 | - * Sets the value of code. |
|
69 | - * |
|
70 | - * @param mixed $code the code |
|
71 | - * |
|
72 | - * @return self |
|
73 | - */ |
|
74 | - public function setCode($code) |
|
75 | - { |
|
76 | - $this->code = $code; |
|
58 | + /** |
|
59 | + * Gets the value of code. |
|
60 | + * |
|
61 | + * @return integer |
|
62 | + */ |
|
63 | + public function getCode() |
|
64 | + { |
|
65 | + return $this->code; |
|
66 | + } |
|
67 | + /** |
|
68 | + * Sets the value of code. |
|
69 | + * |
|
70 | + * @param mixed $code the code |
|
71 | + * |
|
72 | + * @return self |
|
73 | + */ |
|
74 | + public function setCode($code) |
|
75 | + { |
|
76 | + $this->code = $code; |
|
77 | 77 | |
78 | 78 | return $this; |
79 | - } |
|
80 | - /** |
|
81 | - * Gets the value of isValid. |
|
82 | - * |
|
83 | - * @return boolean |
|
84 | - */ |
|
85 | - public function isValid() |
|
86 | - { |
|
87 | - return $this->isValid; |
|
88 | - } |
|
89 | - /** |
|
90 | - * Sets the value of isValid. |
|
91 | - * |
|
92 | - * @param mixed $isValid the is valid |
|
93 | - * |
|
94 | - * @return self |
|
95 | - */ |
|
96 | - public function setIsValid($isValid) |
|
97 | - { |
|
98 | - $this->isValid = $isValid; |
|
79 | + } |
|
80 | + /** |
|
81 | + * Gets the value of isValid. |
|
82 | + * |
|
83 | + * @return boolean |
|
84 | + */ |
|
85 | + public function isValid() |
|
86 | + { |
|
87 | + return $this->isValid; |
|
88 | + } |
|
89 | + /** |
|
90 | + * Sets the value of isValid. |
|
91 | + * |
|
92 | + * @param mixed $isValid the is valid |
|
93 | + * |
|
94 | + * @return self |
|
95 | + */ |
|
96 | + public function setIsValid($isValid) |
|
97 | + { |
|
98 | + $this->isValid = $isValid; |
|
99 | 99 | |
100 | 100 | return $this; |
101 | - } |
|
102 | - /** |
|
103 | - * Gets the Check if email is disponsable. |
|
104 | - * |
|
105 | - * @return boolean |
|
106 | - */ |
|
107 | - public function getIsDisponsable() |
|
108 | - { |
|
109 | - return $this->isDisponsable; |
|
110 | - } |
|
111 | - /** |
|
112 | - * Sets the Check if email is disponsable. |
|
113 | - * |
|
114 | - * @param boolean $isDisponsable the is disponsable |
|
115 | - * |
|
116 | - * @return self |
|
117 | - */ |
|
118 | - public function setIsDisponsable($isDisponsable) |
|
119 | - { |
|
120 | - $this->isDisponsable = $isDisponsable; |
|
101 | + } |
|
102 | + /** |
|
103 | + * Gets the Check if email is disponsable. |
|
104 | + * |
|
105 | + * @return boolean |
|
106 | + */ |
|
107 | + public function getIsDisponsable() |
|
108 | + { |
|
109 | + return $this->isDisponsable; |
|
110 | + } |
|
111 | + /** |
|
112 | + * Sets the Check if email is disponsable. |
|
113 | + * |
|
114 | + * @param boolean $isDisponsable the is disponsable |
|
115 | + * |
|
116 | + * @return self |
|
117 | + */ |
|
118 | + public function setIsDisponsable($isDisponsable) |
|
119 | + { |
|
120 | + $this->isDisponsable = $isDisponsable; |
|
121 | 121 | |
122 | - return $this; |
|
123 | - } |
|
124 | - /** |
|
125 | - * Gets the value of message. |
|
126 | - * |
|
127 | - * @return string |
|
128 | - */ |
|
129 | - public function getMessage() |
|
130 | - { |
|
131 | - return $this->message; |
|
132 | - } |
|
133 | - /** |
|
134 | - * Sets the value of message. |
|
135 | - * |
|
136 | - * @param mixed $message the message |
|
137 | - * |
|
138 | - * @return self |
|
139 | - */ |
|
140 | - public function setMessage($message) |
|
141 | - { |
|
142 | - $this->message = $message; |
|
122 | + return $this; |
|
123 | + } |
|
124 | + /** |
|
125 | + * Gets the value of message. |
|
126 | + * |
|
127 | + * @return string |
|
128 | + */ |
|
129 | + public function getMessage() |
|
130 | + { |
|
131 | + return $this->message; |
|
132 | + } |
|
133 | + /** |
|
134 | + * Sets the value of message. |
|
135 | + * |
|
136 | + * @param mixed $message the message |
|
137 | + * |
|
138 | + * @return self |
|
139 | + */ |
|
140 | + public function setMessage($message) |
|
141 | + { |
|
142 | + $this->message = $message; |
|
143 | 143 | |
144 | 144 | return $this; |
145 | - } |
|
146 | - /** |
|
147 | - * Gets the value of recordMx. |
|
148 | - * |
|
149 | - * @return MxInterface |
|
150 | - */ |
|
151 | - public function getRecordMx() |
|
152 | - { |
|
153 | - return $this->recordMx; |
|
154 | - } |
|
155 | - /** |
|
156 | - * Sets the value of recordMx. |
|
157 | - * |
|
158 | - * @param MxInterface |
|
159 | - * |
|
160 | - * @return self |
|
161 | - */ |
|
162 | - public function setRecordMx(MxInterface $recordMx) |
|
163 | - { |
|
164 | - $this->recordMx = $recordMx; |
|
145 | + } |
|
146 | + /** |
|
147 | + * Gets the value of recordMx. |
|
148 | + * |
|
149 | + * @return MxInterface |
|
150 | + */ |
|
151 | + public function getRecordMx() |
|
152 | + { |
|
153 | + return $this->recordMx; |
|
154 | + } |
|
155 | + /** |
|
156 | + * Sets the value of recordMx. |
|
157 | + * |
|
158 | + * @param MxInterface |
|
159 | + * |
|
160 | + * @return self |
|
161 | + */ |
|
162 | + public function setRecordMx(MxInterface $recordMx) |
|
163 | + { |
|
164 | + $this->recordMx = $recordMx; |
|
165 | 165 | |
166 | 166 | return $this; |
167 | - } |
|
167 | + } |
|
168 | 168 | |
169 | - /** |
|
170 | - * Gets the value of debug. |
|
171 | - * |
|
172 | - * @return mixed |
|
173 | - */ |
|
174 | - public function getDebug() |
|
175 | - { |
|
176 | - return $this->debug; |
|
177 | - } |
|
178 | - /** |
|
179 | - * Sets the value of debug. |
|
180 | - * |
|
181 | - * @param mixed $debug the debug |
|
182 | - * |
|
183 | - * @return self |
|
184 | - */ |
|
185 | - public function setDebug($debug) |
|
186 | - { |
|
187 | - $this->debug = $debug; |
|
169 | + /** |
|
170 | + * Gets the value of debug. |
|
171 | + * |
|
172 | + * @return mixed |
|
173 | + */ |
|
174 | + public function getDebug() |
|
175 | + { |
|
176 | + return $this->debug; |
|
177 | + } |
|
178 | + /** |
|
179 | + * Sets the value of debug. |
|
180 | + * |
|
181 | + * @param mixed $debug the debug |
|
182 | + * |
|
183 | + * @return self |
|
184 | + */ |
|
185 | + public function setDebug($debug) |
|
186 | + { |
|
187 | + $this->debug = $debug; |
|
188 | 188 | |
189 | - return $this; |
|
190 | - } |
|
189 | + return $this; |
|
190 | + } |
|
191 | 191 | } |
192 | 192 | \ No newline at end of file |