Log/Report/Dispatcher/Callback.pm

filter: Statementstmt 68.1% 15 / 22 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 57.1% 4 / 7 Podpod 66.6% 2 / 3 totaltotal 61.7% 21 / 34 CC 2 SCAR 9.2
CC
2
Cov
62%
init
6.0
callback
2.0
log
2.0
CRAP 2.5
« Log/Report/Dispatcher/LogDispatch.pm ↑ Summary Log/Report/DBIC/Profiler.pm »
1 # This code is part of Perl distribution Log-Report version 1.46.
2 # The POD got stripped from this file by OODoc version 3.06.
3 # For contributors see file ChangeLog.
4  
5 # This software is copyright (c) 2007-2026 by Mark Overmeer.
6  
7 # This is free software; you can redistribute it and/or modify it under
8 # the same terms as the Perl 5 programming language system itself.
9 # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
10  
11  
12 package Log::Report::Dispatcher::Callback;{
13 1 our $VERSION = '1.46';
14 }
15  
16 1 ▶use base 'Log::Report::Dispatcher';
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 1 ▶use Log::Report 'log-report', import => [ qw/__x error/ ];
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 #--------------------
24  
25 sub init($)
26 0 ▶{ my ($self, $args) = @_;
Subroutine init: not called CC=2 SCAR=17.9
Pod undocumented
27 0 $self->SUPER::init($args);
28  
29 $self->{callback} = $args->{callback}
30 0 ▶ or error __x"dispatcher {name} needs a 'callback'", name => $self->name;
Branch: 1 branch
BranchTrueFalseTotal
$self->{"callback"} = $args->{"callback"} or &error(&__x("dispatcher {name} needs a 'callback'", "name", $self->name)) 0 0 0
31  
32 0 $self;
33 }
34  
35 #--------------------
36  
37 0 ▶sub callback() { $_[0]->{callback} }
Subroutine callback: not called CC=1 SCAR=6.9
Pod documented
38  
39 #--------------------
40  
41 sub log($$$$)
42 0 ▶{ my $self = shift;
Subroutine log: not called CC=1 SCAR=6.9
Pod documented
43 0 $self->{callback}->($self, @_);
44 }
45  
46 1 1;
« Log/Report/Dispatcher/LogDispatch.pm ↑ Summary Log/Report/DBIC/Profiler.pm »