line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Valiemon::Attributes::MaxProperties; |
2
|
1
|
|
|
1
|
|
636
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
31
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
4
|
1
|
|
|
1
|
|
6
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
5
|
1
|
|
|
1
|
|
26
|
use parent qw(Valiemon::Attributes); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
60
|
use Carp qw(croak); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
219
|
|
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
0
|
10
|
sub attr_name { 'maxProperties' } |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub is_valid { |
12
|
4
|
|
|
4
|
0
|
10
|
my ($class, $context, $schema, $data) = @_; |
13
|
|
|
|
|
|
|
|
14
|
4
|
100
|
|
|
|
15
|
return 1 unless ref $data eq 'HASH'; # ignore |
15
|
|
|
|
|
|
|
|
16
|
3
|
|
|
|
|
6
|
my $max_properties = $schema->{maxProperties}; |
17
|
|
|
|
|
|
|
$context->in_attr($class, sub { |
18
|
3
|
50
|
33
|
3
|
|
8
|
if (!$context->prims->is_integer($max_properties) || !(0 <= $max_properties)) { |
19
|
0
|
|
|
|
|
0
|
croak sprintf '`maxProperties` must be an integer. This integer must be greater than, or equal to 0 at %s', |
20
|
|
|
|
|
|
|
$context->position; |
21
|
|
|
|
|
|
|
} |
22
|
3
|
|
|
|
|
15
|
scalar keys %$data <= $max_properties; |
23
|
3
|
|
|
|
|
17
|
}); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |