Skip to content

Commit 2e76717

Browse files
update
1 parent 169fb21 commit 2e76717

File tree

2 files changed

+7
-139
lines changed

2 files changed

+7
-139
lines changed

src/TameHelper.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static function batchDeepEmailPing(array $emails)
2929
];
3030

3131
foreach ($emails as $email) {
32-
$valid = self::deepEmailPing($email);
32+
$valid = self::deepEmailPing($email, true);
3333
if ($valid) {
3434
$results[$correct][] = $email;
3535
} else {
@@ -46,9 +46,10 @@ public static function batchDeepEmailPing(array $emails)
4646
/**
4747
* Deep Ping Email - Verify Email-Domain Existence, Disposable Emails
4848
* @param string|null $email The email address to verify
49+
* @param bool $disposable Verify disposable emails? Default: false
4950
* @return bool
5051
*/
51-
public static function deepEmailPing($email = null)
52+
public static function deepEmailPing($email = null, $disposable = false)
5253
{
5354
$email = is_array($email) ? Str::flatten($email) : $email;
5455
$email = is_array($email) ? ($email[0] ?? null) : $email;
@@ -64,11 +65,12 @@ public static function deepEmailPing($email = null)
6465

6566
if($emailPingExist){
6667
// check for disposable email
67-
$disposable = Utility::isDisposableEmail($email);
6868
if($disposable){
69-
return false;
69+
$disposable = Utility::isDisposableEmail($email);
70+
if($disposable){
71+
return false;
72+
}
7073
}
71-
7274
return true;
7375
}
7476

tests/tame.php

Lines changed: 0 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -23,140 +23,6 @@
2323
$VolumeWeight = Tame()->calculateVolumeWeight($volume[1]['length'], $volume[1]['width'], $volume[1]['height'], false, 0.5);
2424
$CubicMeterWeight = Tame()->calculateCubicMeterWeight($volume[2]['length'], $volume[2]['width'], $volume[2]['height'], false, 0.1);
2525

26-
27-
// $emailChecker = Tame()->emailValidator('[email protected]');
28-
29-
$emails = [
30-
// your original list (12)
31-
32-
33-
34-
35-
36-
37-
38-
39-
40-
41-
42-
43-
44-
// common providers / likely resolvable (10)
45-
46-
47-
48-
49-
50-
51-
52-
53-
54-
55-
56-
// bogus / non-resolving examples (20)
57-
58-
59-
60-
61-
62-
63-
64-
65-
66-
67-
68-
// mixed additional real / well-known (12)
69-
70-
71-
72-
73-
74-
75-
76-
77-
78-
79-
80-
'bounce@localhost',
81-
82-
// more test / reserved / local (10)
83-
84-
'test@localhost',
85-
86-
87-
88-
89-
90-
91-
92-
93-
94-
// enterprise / intranet style (10)
95-
96-
97-
98-
99-
100-
101-
102-
103-
104-
105-
106-
// business / startup style (12)
107-
108-
109-
110-
111-
112-
113-
114-
115-
116-
117-
118-
119-
120-
// probing / scanning style (14)
121-
122-
123-
124-
125-
126-
127-
128-
129-
130-
131-
132-
133-
134-
135-
136-
// monitoring / ops / edge cases (12)
137-
138-
139-
140-
141-
142-
143-
144-
145-
146-
147-
148-
149-
];
150-
151-
152-
dd(
153-
// $emailChecker,
154-
// Tame::emailPing('[email protected]'),
155-
// Tame::deepEmailPing('[email protected]'),
156-
Tame::batchDeepEmailPing($emails),
157-
);
158-
exit();
159-
16026
dd(
16127
[
16228
Tame::urlExist('google.com'),

0 commit comments

Comments
 (0)