File tree 3 files changed +13
-5328
lines changed
3 files changed +13
-5328
lines changed Original file line number Diff line number Diff line change 10
10
" disposable email check"
11
11
],
12
12
"require" : {
13
- "php" : " ^7.0"
13
+ "php" : " ^7.0" ,
14
+ "ivolo/disposable-email-domains" : " ^1.0"
14
15
},
15
16
"require-dev" : {
16
17
"mockery/mockery" : " ^0.9.9" ,
Original file line number Diff line number Diff line change @@ -8,9 +8,10 @@ class EmailDataProvider implements EmailDataProviderInterface
8
8
{
9
9
const EMAIL_PROVIDERS = __DIR__ . '/data/email-providers.php ' ;
10
10
const TOP_LEVEL_DOMAINS = __DIR__ . '/data/top-level-domains.php ' ;
11
- const DISPOSABLE_EMAIL_PROVIDERS = __DIR__ . '/data/disposable-email-providers.php ' ;
12
11
const ROLE_BASED_EMAIL_PREFIXES = __DIR__ . '/data/role-based-email-prefixes.php ' ;
13
12
13
+ protected $ disposable_email_providers = null ;
14
+
14
15
/**
15
16
* {@inheritdoc}
16
17
*/
@@ -32,7 +33,14 @@ public function getTopLevelDomains(): array
32
33
*/
33
34
public function getDisposableEmailProviders (): array
34
35
{
35
- return include self ::DISPOSABLE_EMAIL_PROVIDERS ;
36
+ if (null == $ this ->disposable_email_providers ) {
37
+ // load index with known disposable email providers
38
+ $ index = \file_get_contents (__DIR__ .'/../vendor/ivolo/disposable-email-domains/index.json ' );
39
+
40
+ $ this ->disposable_email_providers = \json_decode ($ index , true );
41
+ }
42
+
43
+ return $ this ->disposable_email_providers ;
36
44
}
37
45
38
46
/**
@@ -42,4 +50,4 @@ public function getRoleEmailPrefixes(): array
42
50
{
43
51
return include self ::ROLE_BASED_EMAIL_PREFIXES ;
44
52
}
45
- }
53
+ }
You can’t perform that action at this time.
0 commit comments