| 1 | package Valiemon::Attributes::AdditionalProperties; | ||||||||||
| 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 | 3 | ▶ | use Carp qw(croak); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 3 | ▶ | use List::MoreUtils qw(all); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 8 | ▶ | sub attr_name { 'additionalProperties' } | ||||||||
|
Subroutine
attr_name: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 11 | |||||||||||
| 12 | sub is_valid { | ||||||||||
| 13 | 37 | ▶ | my ($class, $context, $schema, $data) = @_; | ||||||||
|
Subroutine
is_valid: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||
| 14 | |||||||||||
| 15 | 37 | ▶ | return 1 unless ref $data eq 'HASH'; # ignore | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | |||||||||||
| 17 | 35 | my $additionalProperties = $schema->{additionalProperties}; | |||||||||
| 18 | 35 | ▶ | return 1 unless defined $additionalProperties; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 35 | ▶ | return 1 if $additionalProperties; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | |||||||||||
| 21 | 8 | my $properties = $schema->{properties}; | |||||||||
| 22 | $context->in_attr($class, sub { | ||||||||||
| 23 | all { | ||||||||||
| 24 | 12 | ▶ | exists $properties->{$_}; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 25 | 8 | ▶ | } keys %$data; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 26 | 8 | }); | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 3 | 1; | |||||||||