Decode/Types.pm

filter: Statementstmt 95.4% 21 / 22 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod n/a totaltotal 87.5% 28 / 32 CC 3 SCAR 6.4
CC
3
Cov
88%
__ANON__
3.1
__ANON__
2.0
BEGIN
1.0
CRAP 1.9
« Decode/Chain.pm ↑ Summary Decode/Encode/Guess.pm »
1 package Data::Decode::Types;
2 7 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 7 ▶use namespace::clean -except => qw(meta);
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 subtype 'Data::Decode::Decoder'
6 => as 'Object'
7 13 ▶ => where { $_->can('decode') }
Subroutine __ANON__: called CC=1 SCAR=0.0
8 0 ▶ => message {
Subroutine __ANON__: not called CC=1 SCAR=6.9
9 0 "$_ does not implement a method named decode()"
10 }
11 7 ;
12  
13 coerce 'Data::Decode::Decoder'
14 => from 'ArrayRef',
15 1 ▶ => via {
Subroutine __ANON__: called CC=1 SCAR=0.0
16 1 Class::MOP::load_class('Data::Decode::Chain');
17 1 Data::Decode::Chain->new(decoders => $_)
18 }
19 7 ;
20  
21 7 subtype 'Data::Decode::DecoderList'
22 => as 'ArrayRef[Data::Decode::Decoder]'
23 ;
24  
25 coerce 'Data::Decode::DecoderList'
26 => from 'ArrayRef'
27 1 ▶ => via {
Subroutine __ANON__: called CC=3 SCAR=11.2
28 1 my @list = @$_;
29 return [
30 map {
31 1 Class::MOP::blessed $_ ? $_ :
32 2 ▶ do {
Branch: 1 branch
BranchTrueFalseTotal
builtin::blessed($_) ? : 0 2 2
33 2 ▶ if (!s/^\+//) {
Branch: 1 branch
BranchTrueFalseTotal
unless (s/^\+//) 2 0 2
34 2 $_ = "Data::Decode::$_";
35 }
36 2 Class::MOP::load_class($_);
37 2 $_->new();
38 }
39 } @list
40 ]
41 }
42 7 ;
43  
44 7 1;
« Decode/Chain.pm ↑ Summary Decode/Encode/Guess.pm »