Workflow/Transition.pm

filter: Statementstmt 100% 13 / 13 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 94.7% 18 / 19 CC 2 SCAR 4.1
CC
2
Cov
93%
derive_and_accept_instance
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« Workflow/Context.pm ↑ Summary Workflow/State/Simple.pm »
1 #!/usr/bin/perl
2  
3 package Class::Workflow::Transition;
4 5 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 5 ▶use Carp qw/croak/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 5 requires "apply";
9  
10 11 ▶sub derive_and_accept_instance {
Subroutine derive_and_accept_instance: called CC=2 SCAR=7.0
Pod documented
11 11 my ( $self, $proto_instance, $attrs, @args ) = @_;
12  
13 croak "You must specify the next state of the instance"
14 11 ▶ unless $attrs->{state};
Branch: 1 branch
BranchTrueFalseTotal
unless $attrs->{"state"} 0 11 11
15  
16 11 my $state = $attrs->{state};
17  
18 11 my $instance = $proto_instance->derive(
19 transition => $self,
20 %$attrs,
21 );
22  
23 11 return $state->accept_instance( $instance, @args );
24 }
25  
26 5 __PACKAGE__;
27  
28 __END__
« Workflow/Context.pm ↑ Summary Workflow/State/Simple.pm »