blib/lib/DTL/Fast/Filter/Linenumbers.pm

filter: Statementstmt 100% 24 / 24 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 96.7% 30 / 31 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/DTL/Fast/Filter/Strftime.pm ↑ Summary blib/lib/DTL/Fast/Expression/Operator.pm »
1 package DTL::Fast::Filter::Linenumbers;
2 2 ▶use strict; use utf8; use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use parent 'DTL::Fast::Filter';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 $DTL::Fast::FILTER_HANDLERS{'linenumbers'} = __PACKAGE__;
6  
7 #@Override
8 sub filter
9 {
10 1 ▶ shift; # self
Subroutine filter: called CC=1 SCAR=0.0
Pod undocumented
11 1 shift; # filter_manager
12 1 my $value = shift; # value
13 1 shift; # context
14  
15
16 1 my $counter = 1;
17 my $nextcounter = sub{
18 6 ▶ return $counter++.". ";
Subroutine __ANON__: called CC=1 SCAR=0.0
19 1 };
20  
21 1 $value =~ s/^/$nextcounter->()/gme;
22
23 1 return $value;
24 }
25  
26 2 1;
« blib/lib/DTL/Fast/Filter/Strftime.pm ↑ Summary blib/lib/DTL/Fast/Expression/Operator.pm »