line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JMAP::Validation::Tests::ContactInformation; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
53
|
use strict; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
106
|
|
4
|
5
|
|
|
5
|
|
16
|
use warnings; |
|
5
|
|
|
|
|
5
|
|
|
5
|
|
|
|
|
106
|
|
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
1535
|
use JMAP::Validation::Tests::Boolean; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
102
|
|
7
|
5
|
|
|
5
|
|
1371
|
use JMAP::Validation::Tests::Object; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
106
|
|
8
|
5
|
|
|
5
|
|
397
|
use JMAP::Validation::Tests::String; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
1605
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub is_ContactInformation { |
11
|
17915952
|
|
|
17915952
|
0
|
10616256
|
my ($value) = @_; |
12
|
|
|
|
|
|
|
|
13
|
17915952
|
50
|
|
|
|
21845212
|
return unless JMAP::Validation::Tests::Object::is_object($value); |
14
|
|
|
|
|
|
|
|
15
|
17915952
|
50
|
|
|
|
25418366
|
return unless JMAP::Validation::Tests::String::is_string($value->{type}); |
16
|
17915952
|
50
|
|
|
|
40907521
|
return unless $value->{type} =~ qr{fax|home|mobile|other|pager|personal|uri|username|work}; |
17
|
|
|
|
|
|
|
|
18
|
17915952
|
100
|
|
|
|
80678093
|
if (defined $value->{label}) { |
19
|
8957976
|
50
|
|
|
|
11870144
|
return unless JMAP::Validation::Tests::String::is_string($value->{label}); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
17915952
|
50
|
|
|
|
23775673
|
return unless JMAP::Validation::Tests::String::is_string($value->{value}); |
23
|
17915952
|
50
|
|
|
|
25032432
|
return unless JMAP::Validation::Tests::Boolean::is_boolean($value->{isDefault}); |
24
|
|
|
|
|
|
|
|
25
|
17915952
|
|
|
|
|
22337675
|
return 1; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub is_ContactInformation_email { |
29
|
4478988
|
|
|
4478988
|
0
|
3140150
|
my ($value) = @_; |
30
|
|
|
|
|
|
|
|
31
|
4478988
|
50
|
|
|
|
3838214
|
return unless is_ContactInformation($value); |
32
|
4478988
|
50
|
|
|
|
10024099
|
return unless $value->{type} =~ qr{personal|work|other}; |
33
|
|
|
|
|
|
|
|
34
|
4478988
|
|
|
|
|
22453145
|
return 1; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub is_ContactInformation_phone { |
38
|
8957976
|
|
|
8957976
|
0
|
6031199
|
my ($value) = @_; |
39
|
|
|
|
|
|
|
|
40
|
8957976
|
50
|
|
|
|
7528830
|
return unless is_ContactInformation($value); |
41
|
8957976
|
50
|
|
|
|
19373876
|
return unless $value->{type} =~ qr{home|work|mobile|fax|pager|other}; |
42
|
|
|
|
|
|
|
|
43
|
8957976
|
|
|
|
|
43994474
|
return 1; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub is_ContactInformation_online { |
47
|
4478988
|
|
|
4478988
|
0
|
3085199
|
my ($value) = @_; |
48
|
|
|
|
|
|
|
|
49
|
4478988
|
50
|
|
|
|
3727274
|
return unless is_ContactInformation($value); |
50
|
4478988
|
50
|
|
|
|
9732192
|
return unless $value->{type} =~ qr{uri|username|other}; |
51
|
|
|
|
|
|
|
|
52
|
4478988
|
|
|
|
|
22347028
|
return 1; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |