| 1 | package Valiemon::Attributes::Minimum; | ||||||||||||
| 2 | 3 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 3 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 3 | ▶ | use utf8; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 3 | ▶ | use parent qw(Valiemon::Attributes); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 21 | ▶ | sub attr_name { 'minimum' } | ||||||||||
|
Subroutine
attr_name: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 8 | |||||||||||||
| 9 | sub is_valid { | ||||||||||||
| 10 | 23 | ▶ | my ($class, $context, $schema, $data) = @_; | ||||||||||
|
Subroutine
is_valid: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||
| 11 | |||||||||||||
| 12 | 23 | ▶ | return 1 unless $context->prims->is_number($data); # skip on non-number value | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 13 | |||||||||||||
| 14 | 21 | my $min = $schema->{minimum}; | |||||||||||
| 15 | 21 | ▶ | my $exclusive = $schema->{exclusiveMinimum} || 0; | ||||||||||
|
Condition100%2/2
$schema->{'exclusiveMinimum'} || 0
MC/DC100%1/1
$schema->{'exclusiveMinimum'} || 0
$schema->{'exclusiveMinimum'}
Truth table100%2/2
A
A= $schema->{'exclusiveMinimum'}
| |||||||||||||
| 16 | $context->in_attr($class, sub { | ||||||||||||
| 17 | 3 | ▶ | no warnings 'numeric'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 18 | 21 | ▶ | $exclusive ? $min < $data : $min <= $data; | ||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
| |||||||||||||
| 19 | 21 | }); | |||||||||||
| 20 | } | ||||||||||||
| 21 | |||||||||||||
| 22 | 3 | 1; | |||||||||||