File Coverage

blib/lib/Dancer2/Plugin/FormValidator/Validator/Required.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 0 2 0.0
total 25 27 92.5


line stmt bran cond sub pod time code
1              
2             use strict;
3 17     17   8875 use warnings;
  17         37  
  17         419  
4 17     17   72  
  17         31  
  17         360  
5             use Moo;
6 17     17   438 use utf8;
  17         5192  
  17         131  
7 17     17   6466 use namespace::clean;
  17         48  
  17         299  
8 17     17   769  
  17         10910  
  17         152  
9             with 'Dancer2::Plugin::FormValidator::Role::Validator';
10              
11             return {
12             en => '%s is required',
13             ru => '%s обязательно для заполнения',
14 3     3 0 1508 de => '%s ist erforderlich',
15             };
16             }
17              
18             around 'stop_on_fail' => sub {
19             return 1;
20             };
21              
22             my ($self, $field, $input) = @_;
23              
24             return $self->_field_defined_and_non_empty($field, $input);
25 41     41 0 99 }
26              
27 41         147 1;