Silki/Role/OptionalLog.pm untested

filter: Statementstmt 0.0% 0 / 22 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 31 CC 2 SCAR 11.5
CC
2
Cov
0%
_maybe_log
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.1
1 package Silki::Role::OptionalLog;
2 {
3 $Silki::Role::OptionalLog::VERSION = '0.29';
4 }
5  
6 use strict;
7 use warnings;
8 use namespace::autoclean;
9  
10 use Silki::Types qw( CodeRef );
11  
12 use Moose::Role;
13  
14 has _log => (
15 is => 'ro',
16 isa => CodeRef,
17 init_arg => 'log',
18 predicate => '_has_log',
19 );
20  
21 sub _maybe_log {
22 my $self = shift;
23  
24 return unless $self->_has_log();
25  
26 $self->_log()->(@_);
27  
28 return;
29 }
30  
31 1;