@@ -64,22 +64,22 @@ class Email
6464 public function __construct (string $ email )
6565 {
6666 $ this ->email = \mb_strtolower (\trim ($ email ));
67-
67+
6868 if (empty ($ this ->email )) {
69- throw new Exception (" Email address cannot be empty " );
69+ throw new Exception (' Email address cannot be empty ' );
7070 }
7171
7272 $ this ->parts = \explode ('@ ' , $ this ->email );
7373
7474 if (count ($ this ->parts ) !== 2 ) {
75- throw new Exception (" ' {$ email }' must be a valid email address" );
75+ throw new Exception ('{$email} must be a valid email address ' );
7676 }
7777
7878 $ this ->local = $ this ->parts [0 ];
7979 $ this ->domain = $ this ->parts [1 ];
8080
8181 if (empty ($ this ->local ) || empty ($ this ->domain )) {
82- throw new Exception (" ' {$ email }' must be a valid email address" );
82+ throw new Exception ('{$email} must be a valid email address ' );
8383 }
8484 }
8585
@@ -142,7 +142,7 @@ public function hasValidLocal(): bool
142142 }
143143
144144 // Check for valid characters in local part
145- if (!preg_match ('/^[a-zA-Z0-9._+-]+$/ ' , $ this ->local )) {
145+ if (! preg_match ('/^[a-zA-Z0-9._+-]+$/ ' , $ this ->local )) {
146146 return false ;
147147 }
148148
@@ -170,7 +170,7 @@ public function hasValidDomain(): bool
170170 }
171171
172172 // Check for valid domain format using filter_var
173- if (!filter_var ('test@ ' . $ this ->domain , FILTER_VALIDATE_EMAIL )) {
173+ if (! filter_var ('test@ ' . $ this ->domain , FILTER_VALIDATE_EMAIL )) {
174174 return false ;
175175 }
176176
@@ -183,7 +183,7 @@ public function hasValidDomain(): bool
183183 public function isDisposable (): bool
184184 {
185185 if (self ::$ disposableDomains === null ) {
186- self ::$ disposableDomains = include __DIR__ . '/../../data/disposable-domains.php ' ;
186+ self ::$ disposableDomains = include __DIR__ . '/../../data/disposable-domains.php ' ;
187187 }
188188
189189 return in_array ($ this ->domain , self ::$ disposableDomains );
@@ -195,7 +195,7 @@ public function isDisposable(): bool
195195 public function isFree (): bool
196196 {
197197 if (self ::$ freeDomains === null ) {
198- self ::$ freeDomains = include __DIR__ . '/../../data/free-domains.php ' ;
198+ self ::$ freeDomains = include __DIR__ . '/../../data/free-domains.php ' ;
199199 }
200200
201201 return in_array ($ this ->domain , self ::$ freeDomains );
@@ -206,7 +206,7 @@ public function isFree(): bool
206206 */
207207 public function isCorporate (): bool
208208 {
209- return !$ this ->isFree () && !$ this ->isDisposable ();
209+ return ! $ this ->isFree () && ! $ this ->isDisposable ();
210210 }
211211
212212 /**
@@ -215,7 +215,7 @@ public function isCorporate(): bool
215215 public function getProvider (): string
216216 {
217217 $ domainParts = explode ('. ' , $ this ->domain );
218-
218+
219219 if (count ($ domainParts ) < 2 ) {
220220 return $ this ->domain ;
221221 }
@@ -234,7 +234,7 @@ public function getProvider(): string
234234 public function getSubdomain (): string
235235 {
236236 $ domainParts = explode ('. ' , $ this ->domain );
237-
237+
238238 if (count ($ domainParts ) <= 2 ) {
239239 return '' ;
240240 }
@@ -247,7 +247,7 @@ public function getSubdomain(): string
247247 */
248248 public function hasSubdomain (): bool
249249 {
250- return !empty ($ this ->getSubdomain ());
250+ return ! empty ($ this ->getSubdomain ());
251251 }
252252
253253 /**
0 commit comments