File Coverage

blib/lib/Dancer2/Plugin/FormValidator/Validator/RequiredWith.pm
Criterion Covered Total %
statement 19 20 95.0
branch 1 2 50.0
condition n/a
subroutine 7 7 100.0
pod 0 2 0.0
total 27 31 87.1


line stmt bran cond sub pod time code
1              
2             use strict;
3 2     2   1172 use warnings;
  2         7  
  2         50  
4 2     2   9  
  2         4  
  2         46  
5             use Moo;
6 2     2   9 use utf8;
  2         4  
  2         8  
7 2     2   547 use namespace::clean;
  2         4  
  2         13  
8 2     2   53  
  2         4  
  2         12  
9             with 'Dancer2::Plugin::FormValidator::Role::Validator';
10              
11             return {
12             en => '%s is required',
13             ru => '%s обязательно для заполнения',
14 1     1 0 1596 de => '%s ist erforderlich',
15             };
16             }
17              
18             around 'stop_on_fail' => sub {
19             return 1;
20             };
21              
22             my ($self, $field, $input, $field2) = @_;
23              
24             if ($self->_field_defined_and_non_empty($field2, $input)) {
25 3     3 0 10 return $self->_field_defined_and_non_empty($field, $input)
26             }
27 3 50       13  
28 3         7 return 1;
29             }
30              
31 0           1;