File Coverage

blib/lib/MooX/Role/Parameterized/With.pm
Criterion Covered Total %
statement 26 26 100.0
branch 1 2 50.0
condition 2 3 66.6
subroutine 8 8 100.0
pod n/a
total 37 39 94.8


line stmt bran cond sub pod time code
1             package MooX::Role::Parameterized::With 0.601;
2              
3 7     7   276935 use v5.12;
  7         53  
4 7     7   65 use strict;
  7         12  
  7         178  
5 7     7   33 use warnings;
  7         12  
  7         360  
6              
7             # ABSTRACT: MooX::Role::Parameterized:With - dsl to apply roles with composition parameters
8              
9 7     7   35 use Carp qw(carp);
  7         12  
  7         480  
10 7     7   1085 use MooX::Role::Parameterized qw();
  7         14  
  7         529  
11              
12             sub import {
13 14     14   7159 my $target = caller;
14              
15             {
16 14         105 my $orig = $target->can('with');
  14         139  
17 14 50 66     86 carp "will redefine 'with' function"
18             if $orig && $MooX::Role::Parameterized::VERBOSE;
19              
20 7     7   66 no strict 'refs';
  7         13  
  7         297  
21 7     7   27 no warnings 'redefine';
  7         10  
  7         716  
22              
23 14         61 *{ $target . '::with' } =
  14         9201  
24             MooX::Role::Parameterized->build_apply_roles_to_package($orig);
25             }
26             }
27              
28             1;
29              
30             __END__