Bolts/Injector/Store/Array.pm

filter: Statementstmt 100% 12 / 12 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod 100% 1 / 1 totaltotal 100% 17 / 17 CC 2 SCAR 5.1
CC
2
Cov
100%
post_inject_value
2.0
BEGIN
1.0
CRAP 1.7
« Bolts/Blueprint/Acquired.pm ↑ Summary Bolts/Meta/Class/Trait/Locator.pm »
1 package Bolts::Injector::Store::Array;
2 4 $Bolts::Injector::Store::Array::VERSION = '0.143171';
3 # ABSTRACT: Inject dependencies into array artifacts
4  
5 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 with 'Bolts::Injector';
8  
9  
10 4 has position => (
11 is => 'ro',
12 isa => 'Int',
13 predicate => 'has_position',
14 );
15  
16  
17 48 ▶sub post_inject_value {
Subroutine post_inject_value: called CC=2 SCAR=6.9
Pod documented
18 48 my ($self, $loc, $value, $array) = @_;
19 48 ▶ if ($self->has_position) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->has_position) { } 4 44 48
20 4 $array->[ $self->position ] = $value;
21 }
22 else {
23 44 push @{ $array }, $value;
24 }
25 }
26  
27 4 __PACKAGE__->meta->make_immutable;
28  
29 __END__
« Bolts/Blueprint/Acquired.pm ↑ Summary Bolts/Meta/Class/Trait/Locator.pm »