FormHandler/Field/NoValue.pm

filter: Statementstmt 80.6% 25 / 31 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 6 / 8 Podpod 66.6% 2 / 3 totaltotal 79.5% 35 / 44 CC 2 SCAR 3.7
CC
2
Cov
82%
_result_from_fields
2.0
_result_from_object
2.0
render
2.0
CRAP 1.4
« FormHandler/Field/Boolean.pm ↑ Summary FormHandler/Field/Repeatable/Instance.pm »
1 package HTML::FormHandler::Field::NoValue;
2 # ABSTRACT: base class for submit field
3 31 $HTML::FormHandler::Field::NoValue::VERSION = '0.410001';
4 31 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 31 extends 'HTML::FormHandler::Field';
6  
7  
8 31 has 'html' => ( is => 'rw', isa => 'Str', default => '' );
9 31 has 'value' => (
10 is => 'rw',
11 predicate => 'has_value',
12 clearer => 'clear_value',
13 );
14  
15 sub _result_from_fields {
16 69 ▶ my ( $self, $result ) = @_;
Subroutine _result_from_fields: called CC=2 SCAR=6.9
17 69 my $value = $self->get_default_value;
18 69 ▶ if ( $value ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($value) 1 68 69
19 1 $self->value($value);
20 }
21 69 $self->_set_result($result);
22 69 $result->_set_field_def($self);
23 69 return $result;
24 }
25  
26 sub _result_from_input {
27 4 ▶ my ( $self, $result, $input, $exists ) = @_;
Subroutine _result_from_input: called CC=1 SCAR=0.0
28 4 $self->_set_result($result);
29 4 $result->_set_field_def($self);
30 4 return $result;
31 }
32  
33 sub _result_from_object {
34 0 ▶ my ( $self, $result, $value ) = @_;
Subroutine _result_from_object: not called CC=1 SCAR=6.9
35 0 $self->_set_result($result);
36 0 $result->_set_field_def($self);
37 0 return $result;
38 }
39  
40 ▶sub fif { }
Subroutine fif: called CC=1 SCAR=0.0
Pod documented
41  
42 31 has '+widget' => ( default => '' );
43 31 has '+noupdate' => ( default => 1 );
44  
45 ▶sub validate_field { }
Subroutine validate_field: called CC=1 SCAR=0.0
Pod documented
46  
47 #sub clear_value { }
48  
49 sub render {
50 0 ▶ my $self = shift;
Subroutine render: not called CC=1 SCAR=6.9
Pod undocumented
51 0 return $self->html;
52 }
53  
54 31 __PACKAGE__->meta->make_immutable;
55 31 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
56 31 1;
57  
58 __END__
59  
60 =pod
61  
62 =encoding UTF-8
63  
64 =head1 NAME
65  
66 HTML::FormHandler::Field::NoValue - base class for submit field
67  
68 =head1 VERSION
69  
70 version 0.410001
71  
72 =head1 SYNOPSIS
73  
74 This is the base class for the Submit & Reset fields. It can be used for fields that
75 do not produce valid 'values'. It should not be used for fields that
76 produce a value or need validating.
77  
78 =head1 AUTHOR
79  
80 FormHandler Contributors - see HTML::FormHandler
81  
82 =head1 COPYRIGHT AND LICENSE
83  
84 This software is copyright (c) 2017 by Gerda Shank.
85  
86 This is free software; you can redistribute it and/or modify it under
87 the same terms as the Perl 5 programming language system itself.
88  
89 =cut
« FormHandler/Field/Boolean.pm ↑ Summary FormHandler/Field/Repeatable/Instance.pm »