blib/lib/Mason/DynamicFilter.pm

filter: Statementstmt 96.5% 28 / 29 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 94.4% 34 / 36 CC 2 SCAR 3.1
CC
2
Cov
94%
__ANON__
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« blib/lib/Mason/t/ComponentMeta.pm ↑ Summary blib/lib/Mason/TieHandle.pm »
1 package Mason::DynamicFilter;
2 13 $Mason::DynamicFilter::VERSION = '2.24';
3 21 ▶use Mason::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 13 has 'filter' => ( isa => 'CodeRef' );
6  
7 9 ▶around 'BUILDARGS' => sub {
Subroutine __ANON__: called CC=2 SCAR=7.4
8 9 my $orig = shift;
9 9 my $class = shift;
10 9 ▶ if ( @_ == 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_ == 1) { } 0 9 9
11 0 return $class->$orig( filter => $_[0] );
12 }
13 else {
14 9 return $class->$orig(@_);
15 }
16 13 };
17  
18 21 ▶method apply_filter () {
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine apply_filter: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
19 8 my ($yield) = @_;
20 8 return $self->filter->($yield);
21 13 }
22  
23 13 __PACKAGE__->meta->make_immutable();
24  
25 13 1;
« blib/lib/Mason/t/ComponentMeta.pm ↑ Summary blib/lib/Mason/TieHandle.pm »