line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Valiemon::Attributes::AllOf; |
2
|
1
|
|
|
1
|
|
508
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
27
|
|
3
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
4
|
1
|
|
|
1
|
|
3
|
use utf8; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
5
|
1
|
|
|
1
|
|
18
|
use parent qw(Valiemon::Attributes); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
191
|
use Carp qw(croak); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
50
|
|
8
|
1
|
|
|
1
|
|
4
|
use List::MoreUtils qw(all); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
9
|
|
|
|
|
|
|
|
10
|
11
|
|
|
11
|
0
|
18
|
sub attr_name { 'allOf' } |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub is_valid { |
13
|
11
|
|
|
11
|
0
|
13
|
my ($class, $context, $schema, $data) = @_; |
14
|
|
|
|
|
|
|
|
15
|
11
|
|
|
|
|
13
|
my $allOf = $schema->{allOf}; |
16
|
|
|
|
|
|
|
$context->in_attr($class, sub { |
17
|
11
|
50
|
33
|
11
|
|
47
|
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
|
|
|
|
|
9
|
my $idx = 0; |
22
|
|
|
|
|
|
|
all { |
23
|
17
|
|
|
|
|
32
|
my $sub_v = $context->sub_validator($_); |
24
|
17
|
|
|
|
|
63
|
$context->in($idx++, sub { $sub_v->validate($data, $context); }); |
|
17
|
|
|
|
|
29
|
|
25
|
11
|
|
|
|
|
39
|
} @$allOf; |
26
|
11
|
|
|
|
|
48
|
}); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |