HTML/FormFu/Plugin/RequestToken.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 100% 29 / 29 CC 2 SCAR 3.4
CC
2
Cov
100%
process
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« Catalyst/Controller/HTML/FormFu/Action/Form.pm ↑ Summary HTML/FormFu/Constraint/RequestToken.pm »
1 package HTML::FormFu::Plugin::RequestToken;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 our $VERSION = '2.04'; # VERSION
6 1 our $AUTHORITY = 'cpan:NIGELM'; # AUTHORITY
7  
8 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use MooseX::Attribute::Chained;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 extends 'HTML::FormFu::Plugin';
11  
12 1 has context => ( is => 'rw', traits => ['Chained'] );
13 1 has field_name => ( is => 'rw', traits => ['Chained'] );
14 1 has session_key => ( is => 'rw', traits => ['Chained'] );
15 1 has expiration_time => ( is => 'rw', traits => ['Chained'] );
16  
17 51 ▶sub process {
Subroutine process: called CC=2 SCAR=6.9
Pod documented
18 51 my ($self) = @_;
19  
20 51 ▶ return if $self->form->get_all_element( { name => $self->field_name } );
Branch: 1 branch
BranchTrueFalseTotal
if $self->form->get_all_element({"name", $self->field_name}) 25 26 51
21  
22 26 my $c = $self->form->stash->{'context'};
23  
24 26 $self->form->elements(
25 [ { type => 'RequestToken',
26 name => $self->field_name,
27 expiration_time => $self->expiration_time,
28 context => $self->context,
29 session_key => $self->session_key
30 }
31 ]
32 );
33  
34 26 return;
35 }
36  
37 1 1;
38  
39 __END__
« Catalyst/Controller/HTML/FormFu/Action/Form.pm ↑ Summary HTML/FormFu/Constraint/RequestToken.pm »