WebApp/Segment/User/SaveInSession.pm

filter: Statementstmt 100% 14 / 14 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 90.9% 20 / 22 CC 2 SCAR 3.5
CC
2
Cov
94%
dispatch
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« WebApp/Session/Factory.pm ↑ Summary WebApp/Segment/Decline/UserInSession.pm »
1 =head1 NAME
2  
3 OpenFrame::WebApp::Segment::User::SaveInSession - save user to session.
4  
5 =head1 SYNOPSIS
6  
7 use Pipeline;
8 use OpenFrame::WebApp;
9  
10 my $pipe = new Pipeline;
11  
12 $OpenFrame::WebApp::Segment::User::Session::USER_KEY = 'my_user';
13  
14 my $usaver = new OpenFrame::WebApp::Segment::User::SaveInSession;
15 $pipe->add_segment( $uloader, ... $usaver, ... );
16  
17 $pipe->dispatch;
18  
19 =cut
20  
21 package OpenFrame::WebApp::Segment::User::SaveInSession;
22  
23 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 1 ▶use warnings::register;
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 1 ▶use base qw( OpenFrame::WebApp::Segment::User
Subroutine BEGIN: called CC=1 SCAR=0.0
27 1 OpenFrame::WebApp::Segment::User::Session );
28  
29 1 our $VERSION = (split(/ /, '$Revision: 1.2 $'))[1];
30  
31 1 ▶sub dispatch {
Subroutine dispatch: called CC=2 SCAR=7.1
Pod documented
32 1 my $self = shift;
33 1 ▶ my $user = $self->get_user_from_store || return;
Condition50%1/2
$self->get_user_from_store || (return)
l!l
10
MC/DC0%0/1
$self->get_user_from_store || (return)
$self->get_user_from_store
Truth table50%1/2
A
A= $self->get_user_from_store
Aresult
11
00
34 1 return $self->save_user_in_session( $user );
35 }
36  
37 1 1;
38  
39 __END__
« WebApp/Session/Factory.pm ↑ Summary WebApp/Segment/Decline/UserInSession.pm »