Provider.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
« Filter.pm ↑ Summary Role/Dispatcher.pm »
1 package Patterns::ChainOfResponsibility::Provider;
2
3 3 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 with 'Patterns::ChainOfResponsibility::Role::Dispatcher';
5  
6 12 ▶sub dispatch {
Subroutine dispatch: called CC=3 SCAR=11.2
Pod undocumented
7 12 my ($self, $current_handler, $return, $args) = @_;
8 12 ▶ if(@$return) {
Branch: 1 branch
BranchTrueFalseTotal
if (@$return) { } 6 6 12
9 6 return @$return;
10 } else {
11 6 ▶ if($current_handler->no_handlers) {
Branch: 1 branch
BranchTrueFalseTotal
if ($current_handler->no_handlers) { } 0 6 6
12 0 return;
13 } else {
14 6 return $self->next_handler($current_handler, @$args);
15 }
16 }
17 }
18  
19 =head1 NAME
20
21 Patterns::ChainOfResponsibility::Provider - The Provider Dispatch Strategy
22  
23 =head1 DESCRIPTION
24  
25 Dispatch @args to each Handler in turn until we find one that processes them.
26 This is probably the most classic "CoR" behavior.
27  
28 You won't use this class directly.
29 Please see L<Patterns::ChainOfResponsibility::Role::Handler>
30
31 =head1 AUTHOR
32  
33 John Napiorkowski C<< <jjnapiork@cpan.org> >>
34
35 =head1 LICENSE & COPYRIGHT
36
37 Copyright 2011, John Napiorkowski C<< <jjnapiork@cpan.org> >>
38  
39 This program is free software; you can redistribute it and/or modify
40 it under the same terms as Perl itself.
41
42 =cut
43  
44 3 1;
« Filter.pm ↑ Summary Role/Dispatcher.pm »