line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Valiemon::Attributes::AllOf; |
2
|
1
|
|
|
1
|
|
667
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
4
|
1
|
|
|
1
|
|
5
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
5
|
1
|
|
|
1
|
|
28
|
use parent qw(Valiemon::Attributes); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
61
|
use Carp qw(croak); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
8
|
1
|
|
|
1
|
|
15
|
use List::MoreUtils qw(all); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
7
|
|
9
|
|
|
|
|
|
|
|
10
|
11
|
|
|
11
|
0
|
33
|
sub attr_name { 'allOf' } |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub is_valid { |
13
|
11
|
|
|
11
|
0
|
25
|
my ($class, $context, $schema, $data) = @_; |
14
|
|
|
|
|
|
|
|
15
|
11
|
|
|
|
|
22
|
my $allOf = $schema->{allOf}; |
16
|
|
|
|
|
|
|
$context->in_attr($class, sub { |
17
|
11
|
50
|
33
|
11
|
|
55
|
if (ref $allOf ne 'ARRAY' || scalar @$allOf < 1) { |
18
|
0
|
|
|
|
|
0
|
croak sprintf '`allOf` must be an array and have at least one element at %s', $context->position |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
11
|
|
|
|
|
15
|
my $idx = 0; |
22
|
|
|
|
|
|
|
all { |
23
|
16
|
|
|
|
|
47
|
my $sub_v = $context->sub_validator($_); |
24
|
16
|
|
|
|
|
87
|
$context->in($idx++, sub { $sub_v->validate($data, $context); }); |
|
16
|
|
|
|
|
42
|
|
25
|
11
|
|
|
|
|
50
|
} @$allOf; |
26
|
11
|
|
|
|
|
56
|
}); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |