| 1 | package JSV::Keyword::Draft4::MinLength; | ||||||||||
| 2 | |||||||||||
| 3 | 47 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 47 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 47 | ▶ | use parent qw(JSV::Keyword); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 47 | ▶ | use JSV::Keyword qw(:constants); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | sub instance_type() { INSTANCE_TYPE_STRING(); } | ||||||||||
| 10 | sub keyword() { "minLength" } | ||||||||||
| 11 | sub keyword_priority() { 10; } | ||||||||||
| 12 | |||||||||||
| 13 | 16 | ▶ | sub validate { | ||||||||
|
Subroutine
validate: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 14 | 16 | my ($class, $context, $schema, $instance) = @_; | |||||||||
| 15 | |||||||||||
| 16 | 16 | my $keyword_value = $class->keyword_value($schema); | |||||||||
| 17 | |||||||||||
| 18 | 16 | ▶ | if (length($instance) < $keyword_value) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 5 | $context->log_error("The instance length is less than minLength value"); | |||||||||
| 20 | } | ||||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 47 | 1; | |||||||||