line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JMAP::Validation::Generators::ContactInformation; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
362
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
66
|
|
4
|
3
|
|
|
3
|
|
11
|
use warnings; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
58
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
284
|
use JMAP::Validation::Generators::String; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
68
|
|
7
|
3
|
|
|
3
|
|
11
|
use JSON::PP; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
126
|
|
8
|
3
|
|
|
3
|
|
11
|
use JSON::Typist; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
360
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my %types = ( |
11
|
|
|
|
|
|
|
emails => [qw{ |
12
|
|
|
|
|
|
|
personal |
13
|
|
|
|
|
|
|
work |
14
|
|
|
|
|
|
|
other |
15
|
|
|
|
|
|
|
}], |
16
|
|
|
|
|
|
|
phones => [qw{ |
17
|
|
|
|
|
|
|
home |
18
|
|
|
|
|
|
|
work |
19
|
|
|
|
|
|
|
mobile |
20
|
|
|
|
|
|
|
fax |
21
|
|
|
|
|
|
|
pager |
22
|
|
|
|
|
|
|
other |
23
|
|
|
|
|
|
|
}], |
24
|
|
|
|
|
|
|
online => [qw{ |
25
|
|
|
|
|
|
|
uri |
26
|
|
|
|
|
|
|
username |
27
|
|
|
|
|
|
|
other |
28
|
|
|
|
|
|
|
}], |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub generate { |
32
|
9
|
|
|
9
|
0
|
493
|
my ($type) = @_; |
33
|
|
|
|
|
|
|
|
34
|
9
|
|
|
|
|
10
|
my @ContactInformation; |
35
|
|
|
|
|
|
|
|
36
|
9
|
50
|
|
|
|
6
|
foreach my $type_value (@{$types{$type} || []}) { |
|
9
|
|
|
|
|
33
|
|
37
|
36
|
|
|
|
|
855
|
foreach my $label (JMAP::Validation::Generators::String->generate(), undef) { |
38
|
72
|
|
|
|
|
3290
|
foreach my $isDefault (JSON::PP::true, JSON::PP::false) { |
39
|
144
|
|
|
|
|
2452
|
push @ContactInformation, { |
40
|
|
|
|
|
|
|
type => JSON::Typist::String->new($type_value), |
41
|
|
|
|
|
|
|
label => $label, |
42
|
|
|
|
|
|
|
value => JMAP::Validation::Generators::String->generate(), |
43
|
|
|
|
|
|
|
isDefault => $isDefault, |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
9
|
|
|
|
|
309
|
return @ContactInformation; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |