TypeInference/Type/Array.pm

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 5 totaltotal 82.7% 24 / 29 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
new
1.0
CRAP 1.0
« TypeInference/Type/Object.pm ↑ Summary TypeInference/Type/Atom.pm »
1 package JSON::TypeInference::Type::Array;
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  
5 4 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
6 4 my ($class, $element_type) = @_;
7 4 return bless { element_type => $element_type }, $class;
8 }
9  
10 1 ▶sub name {
Subroutine name: called CC=1 SCAR=0.0
Pod undocumented
11 1 my ($class) = @_;
12 1 return 'array';
13 }
14  
15 # => Type
16 4 ▶sub element_type {
Subroutine element_type: called CC=1 SCAR=0.0
Pod undocumented
17 4 my ($self) = @_;
18 4 return $self->{element_type};
19 }
20  
21 1 ▶sub signature {
Subroutine signature: called CC=1 SCAR=0.0
Pod undocumented
22 1 my ($self) = @_;
23 1 return sprintf 'array[%s]', $self->element_type->signature;
24 }
25  
26 47 ▶sub accepts {
Subroutine accepts: called CC=1 SCAR=0.0
Pod undocumented
27 47 my ($class, $data) = @_;
28 47 return ref($data) eq 'ARRAY';
29 }
30  
31 3 1;
32 __END__
« TypeInference/Type/Object.pm ↑ Summary TypeInference/Type/Atom.pm »