QBit/WebInterface/Controller/Form/Field/email.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 27 CC 2 SCAR 12.0
CC
2
Cov
0%
check
6.0
init
2.0
BEGIN
2.0
CRAP 3.3
1 package QBit::WebInterface::Controller::Form::Field::email;
2 $QBit::WebInterface::Controller::Form::Field::email::VERSION = '0.033';
3 use qbit;
4  
5 use base qw(QBit::WebInterface::Controller::Form::Field::input);
6  
7 use Exception::Form;
8  
9 sub init {
10 my ($self) = @_;
11  
12 $self->SUPER::init();
13  
14 push_hs(
15 $self,
16 {
17 input_type => 'text',
18 trim => TRUE,
19 placeholder => 'name@example.com'
20 }
21 );
22 }
23  
24 sub check {
25 my ($self) = @_;
26  
27 $self->SUPER::check();
28  
29 throw Exception::Form gettext('Invalid E-Mail') unless check_email($self->value);
30  
31 return TRUE;
32 }
33  
34 TRUE;