TypeInference/Type/Object.pm

filter: Statementstmt 90.4% 19 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 5 totaltotal 75.7% 25 / 33 CC 1 SCAR 1.3
CC
1
Cov
90%
name
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« TypeInference/Type/Union.pm ↑ Summary TypeInference/Type/Array.pm »
1 package JSON::TypeInference::Type::Object;
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, $properties) = @_;
7 4 return bless { properties => $properties }, $class;
8 }
9  
10 0 ▶sub name {
Subroutine name: not called CC=1 SCAR=6.9
Pod undocumented
11 0 my ($class) = @_;
12 0 return 'object';
13 }
14  
15 6 ▶sub properties {
Subroutine properties: called CC=1 SCAR=0.0
Pod undocumented
16 6 my ($self) = @_;
17 6 return $self->{properties};
18 }
19  
20 17 ▶sub accepts {
Subroutine accepts: called CC=1 SCAR=0.0
Pod undocumented
21 17 my ($class, $data) = @_;
22 17 return ref($data) eq 'HASH';
23 }
24  
25 1 ▶sub signature {
Subroutine signature: called CC=1 SCAR=0.0
Pod undocumented
26 1 my ($self) = @_;
27 1 my @sorted_keys = sort keys %{$self->properties};
28 1 my @prop_signatures = map { join ':', $_, $self->properties->{$_}->signature } @sorted_keys;
29 1 return sprintf 'object[%s]', join ', ', @prop_signatures;
30 }
31  
32 3 1;
33 __END__
« TypeInference/Type/Union.pm ↑ Summary TypeInference/Type/Array.pm »