Filter.pm

filter: Statementstmt 90.9% 10 / 11 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod 0.0% 0 / 1 totaltotal 83.3% 15 / 18 CC 3 SCAR 9.4
CC
3
Cov
87%
dispatch
3.1
BEGIN
1.0
CRAP 2.6
« Broadcast.pm ↑ Summary Provider.pm »
1 package Patterns::ChainOfResponsibility::Filter;
2
3 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 with 'Patterns::ChainOfResponsibility::Role::Dispatcher';
5  
6 9 ▶sub dispatch {
Subroutine dispatch: called CC=3 SCAR=11.2
Pod undocumented
7 9 my ($self, $current_handler, $return, $args) = @_;
8 9 ▶ if(@$return) {
Branch: 1 branch
BranchTrueFalseTotal
if (@$return) { } 9 0 9
9 9 ▶ if($current_handler->no_handlers) {
Branch: 1 branch
BranchTrueFalseTotal
if ($current_handler->no_handlers) { } 3 6 9
10 3 return @$return;
11 } else {
12 6 return $self->next_handler($current_handler, @$return);
13 }
14 } else {
15 0 return;
16 }
17 }
18
19 =head1 NAME
20
21 Patterns::ChainOfResponsibility::Filter - The Filter Dispatch Strategy
22  
23 =head1 DESCRIPTION
24  
25 Dispatch @args to each Handler in turn, passing the results of each handler
26 to the next unless one handler returns nothing, in which case we exit the
27 chain immediately.
28  
29 You won't use this class directly.
30 Please see L<Patterns::ChainOfResponsibility::Role::Handler>
31
32 =head1 AUTHOR
33  
34 John Napiorkowski C<< <jjnapiork@cpan.org> >>
35
36 =head1 LICENSE & COPYRIGHT
37
38 Copyright 2011, John Napiorkowski C<< <jjnapiork@cpan.org> >>
39  
40 This program is free software; you can redistribute it and/or modify
41 it under the same terms as Perl itself.
42
43 =cut
44  
45 2 1;
« Broadcast.pm ↑ Summary Provider.pm »