| 1 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | package Data::Rx::CoreType::all; | ||||||||||||||||||||||||||||||||||||||||||
| 4 | # ABSTRACT: the Rx //all type | ||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | $Data::Rx::CoreType::all::VERSION = '0.200007'; | |||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use parent 'Data::Rx::CoreType'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use Scalar::Util (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | sub guts_from_arg { | ||||||||||||||||||||||||||||||||||||||||||
| 11 | 4 | ▶ | my ($class, $arg, $rx, $type) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
guts_from_arg: called CC=6 SCAR=18.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | 4 | ▶ | Carp::croak("unknown arguments to new") | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 14 | unless Data::Rx::Util->_x_subset_keys_y($arg, { of => 1}); | ||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||
| 16 | 4 | ▶ | Carp::croak("no 'of' parameter given to //all") unless exists $arg->{of}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | 3 | my $of = $arg->{of}; | |||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | 3 | ▶ | Carp::croak("invalid 'of' argument to //all") unless | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
defined $of and builtin::reftype($of) eq "ARRAY" and @$of
defined $of and builtin::reftype($of) eq "ARRAY"
MC/DC33%1/3
defined $of and builtin::reftype($of) eq "ARRAY" and @$of
defined $of
builtin::reftype($of) eq "ARRAY"
@$of
Truth table50%2/4
A and B and C
A= defined $ofB= builtin::reftype($of) eq "ARRAY"C= @$of
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | defined $of and Scalar::Util::reftype $of eq 'ARRAY' and @$of; | ||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | 2 | return { of => [ map {; $rx->make_schema($_) } @$of ] }; | |||||||||||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | sub assert_valid { | ||||||||||||||||||||||||||||||||||||||||||
| 27 | 53 | ▶ | my ($self, $value) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
assert_valid: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | 53 | my @subchecks; | |||||||||||||||||||||||||||||||||||||||||
| 30 | 53 | for my $i (0 .. $#{ $self->{of} }) { | |||||||||||||||||||||||||||||||||||||||||
| 31 | push @subchecks, [ | ||||||||||||||||||||||||||||||||||||||||||
| 32 | $value, | ||||||||||||||||||||||||||||||||||||||||||
| 33 | 106 | $self->{of}[$i], | |||||||||||||||||||||||||||||||||||||||||
| 34 | { | ||||||||||||||||||||||||||||||||||||||||||
| 35 | check_path => [ [ 'of', 'key'], [ $i, 'index' ] ], | ||||||||||||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||||||||||||
| 37 | ]; | ||||||||||||||||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||
| 40 | 53 | $self->perform_subchecks(\@subchecks); | |||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||
| 42 | 2 | return 1; | |||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||
| 45 | 54 | ▶ | sub subname { 'all' } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
subname: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | __END__ | ||||||||||||||||||||||||||||||||||||||||||