line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JMAP::Validation::Tests::ContactInformation; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
18
|
use strict; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
163
|
|
4
|
5
|
|
|
5
|
|
16
|
use warnings; |
|
5
|
|
|
|
|
5
|
|
|
5
|
|
|
|
|
100
|
|
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
1559
|
use JMAP::Validation::Tests::Boolean; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
116
|
|
7
|
5
|
|
|
5
|
|
1560
|
use JMAP::Validation::Tests::Object; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
108
|
|
8
|
5
|
|
|
5
|
|
351
|
use JMAP::Validation::Tests::String; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
1722
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub is_ContactInformation { |
11
|
17915952
|
|
|
17915952
|
0
|
10937463
|
my ($value) = @_; |
12
|
|
|
|
|
|
|
|
13
|
17915952
|
50
|
|
|
|
21684020
|
return unless JMAP::Validation::Tests::Object::is_object($value); |
14
|
|
|
|
|
|
|
|
15
|
17915952
|
50
|
|
|
|
26691163
|
return unless JMAP::Validation::Tests::String::is_string($value->{type}); |
16
|
17915952
|
50
|
|
|
|
43897536
|
return unless $value->{type} =~ qr{fax|home|mobile|other|pager|personal|uri|username|work}; |
17
|
|
|
|
|
|
|
|
18
|
17915952
|
100
|
|
|
|
86670077
|
if (defined $value->{label}) { |
19
|
8957976
|
50
|
|
|
|
12647009
|
return unless JMAP::Validation::Tests::String::is_string($value->{label}); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
17915952
|
50
|
|
|
|
25243922
|
return unless JMAP::Validation::Tests::String::is_string($value->{value}); |
23
|
17915952
|
50
|
|
|
|
25382937
|
return unless JMAP::Validation::Tests::Boolean::is_boolean($value->{isDefault}); |
24
|
|
|
|
|
|
|
|
25
|
17915952
|
|
|
|
|
23269230
|
return 1; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub is_ContactInformation_email { |
29
|
4478988
|
|
|
4478988
|
0
|
3141381
|
my ($value) = @_; |
30
|
|
|
|
|
|
|
|
31
|
4478988
|
50
|
|
|
|
3889304
|
return unless is_ContactInformation($value); |
32
|
4478988
|
50
|
|
|
|
10598660
|
return unless $value->{type} =~ qr{personal|work|other}; |
33
|
|
|
|
|
|
|
|
34
|
4478988
|
|
|
|
|
24412198
|
return 1; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub is_ContactInformation_phone { |
38
|
8957976
|
|
|
8957976
|
0
|
6130817
|
my ($value) = @_; |
39
|
|
|
|
|
|
|
|
40
|
8957976
|
50
|
|
|
|
7547169
|
return unless is_ContactInformation($value); |
41
|
8957976
|
50
|
|
|
|
20965521
|
return unless $value->{type} =~ qr{home|work|mobile|fax|pager|other}; |
42
|
|
|
|
|
|
|
|
43
|
8957976
|
|
|
|
|
47150954
|
return 1; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub is_ContactInformation_online { |
47
|
4478988
|
|
|
4478988
|
0
|
3147268
|
my ($value) = @_; |
48
|
|
|
|
|
|
|
|
49
|
4478988
|
50
|
|
|
|
3852637
|
return unless is_ContactInformation($value); |
50
|
4478988
|
50
|
|
|
|
10483005
|
return unless $value->{type} =~ qr{uri|username|other}; |
51
|
|
|
|
|
|
|
|
52
|
4478988
|
|
|
|
|
23705874
|
return 1; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |