Aspect/Pointcut/Wantarray.pm

filter: Statementstmt 100% 34 / 34 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 12 / 12 Podpod 100% 3 / 3 totaltotal 100% 53 / 53 SCAR 11.0
CC
3
Cov
100%
new
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« Aspect/Point/Around.pm ↑ Summary Aspect/Point/After.pm »
1 package Aspect::Pointcut::Wantarray;
2  
3 21 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 21 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 21 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
6 21 ▶use Aspect::Pointcut ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 21 our $VERSION = '0.97_06';
9 21 our @ISA = 'Aspect::Pointcut';
10  
11 21 ▶use constant VOID => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 21 ▶use constant SCALAR => 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 21 ▶use constant LIST => 3;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15  
16  
17  
18  
19 ######################################################################
20 # Constructor Methods
21  
22 sub new {
23 32 ▶ return bless [
Subroutine new: called CC=3 SCAR=11.0
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
if $_[1] 13 19 32
24 LIST,
25 '$_->{wantarray}',
26 ], $_[0] if $_[1];
27  
28 19 ▶ return bless [
Branch: 1 branch
BranchTrueFalseTotal
if defined $_[1] 10 9 19
29 SCALAR,
30 'defined $_->{wantarray} and not $_->{wantarray}',
31 ], $_[0] if defined $_[1];
32  
33 9 return bless [
34 VOID,
35 'not defined $_->{wantarray}',
36 ], $_[0];
37 }
38  
39  
40  
41  
42  
43 ######################################################################
44 # Weaving Methods
45  
46 # This is a run-time only pointcut of no value at weave time
47 sub curry_weave {
48 27 ▶ return;
Subroutine curry_weave: called CC=1 SCAR=0.0
Pod documented
49 }
50  
51 # For wantarray pointcuts we keep the original
52 sub curry_runtime {
53 32 ▶ return $_[0];
Subroutine curry_runtime: called CC=1 SCAR=0.0
Pod documented
54 }
55  
56 sub compile_runtime {
57 $_[0]->[1];
58 }
59  
60  
61  
62  
63  
64 ######################################################################
65 # Optional XS Acceleration
66  
67 BEGIN {
68 21 ▶ local $@;
Subroutine BEGIN: called CC=1 SCAR=0.0
69 21 ▶ eval <<'END_PERL';
Subroutine BEGIN: called CC=1 SCAR=0.0
70 use Class::XSAccessor::Array 1.08 {
71 replace => 1,
72 getters => {
73 'compile_runtime' => 1,
74 },
75 };
76 END_PERL
77 }
78  
79 21 1;
80  
81 __END__
« Aspect/Point/Around.pm ↑ Summary Aspect/Point/After.pm »