line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
1777
|
use 5.008; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
43
|
|
2
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
69
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Class::Value::Contact::EmailAddress; |
6
|
|
|
|
|
|
|
our $VERSION = '1.100840'; |
7
|
|
|
|
|
|
|
# ABSTRACT: Contact-related value objects |
8
|
1
|
|
|
1
|
|
967
|
use Email::Valid; |
|
1
|
|
|
|
|
153486
|
|
|
1
|
|
|
|
|
16
|
|
9
|
1
|
|
|
1
|
|
43
|
use parent 'Class::Value::Contact'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub is_well_formed_value { |
12
|
15
|
|
|
15
|
1
|
15980
|
my ($self, $value) = @_; |
13
|
|
|
|
|
|
|
return |
14
|
15
|
|
66
|
|
|
54
|
$self->SUPER::is_well_formed_value($value) |
15
|
|
|
|
|
|
|
&& Email::Valid->address($value) |
16
|
|
|
|
|
|
|
&& $value =~ /^[^\@]+\@[^\@]+$/ |
17
|
|
|
|
|
|
|
&& # only one '@' sign |
18
|
|
|
|
|
|
|
length($value) <= 255; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub send_notify_value_not_wellformed { |
22
|
0
|
|
|
0
|
1
|
|
my ($self, $value) = @_; |
23
|
0
|
|
|
|
|
|
local $Error::Depth = $Error::Depth + 2; |
24
|
0
|
|
|
|
|
|
$self->exception_container->record( |
25
|
|
|
|
|
|
|
'Class::Value::Contact::Exception::Email::NotWellformed', |
26
|
|
|
|
|
|
|
email => $value,); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub send_notify_value_invalid { |
30
|
0
|
|
|
0
|
1
|
|
my ($self, $value) = @_; |
31
|
0
|
|
|
|
|
|
local $Error::Depth = $Error::Depth + 2; |
32
|
0
|
|
|
|
|
|
$self->exception_container->record( |
33
|
|
|
|
|
|
|
'Class::Value::Contact::Exception::Email::Invalid', |
34
|
|
|
|
|
|
|
email => $value,); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |