FormValidator/Validator/RequiredWith.pm

filter: Statementstmt 95.8% 23 / 24 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 2 totaltotal 88.8% 32 / 36 CC 2 SCAR 2.3
CC
2
Cov
92%
validate
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« FormValidator/Validator/Enum.pm ↑ Summary FormValidator/Validator/LengthMax.pm »
1 package Dancer2::Plugin::FormValidator::Validator::RequiredWith;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 with 'Dancer2::Plugin::FormValidator::Role::Validator';
11  
12 sub message {
13 return {
14 1 ▶ en => '%s is required',
Subroutine message: called CC=1 SCAR=0.0
Pod undocumented
15 ru => '%s обязательно для заполнения',
16 de => '%s ist erforderlich',
17 };
18 }
19  
20 around 'stop_on_fail' => sub {
21 1 ▶ return 1;
Subroutine __ANON__: called CC=1 SCAR=0.0
22 2 };
23  
24 sub validate {
25 3 ▶ my ($self, $field, $input, $field2) = @_;
Subroutine validate: called CC=2 SCAR=7.6
Pod undocumented
26  
27 3 ▶ if ($self->_field_defined_and_non_empty($field2, $input)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->_field_defined_and_non_empty($field2, $input)) 3 0 3
28 3 return $self->_field_defined_and_non_empty($field, $input)
29 }
30  
31 0 return 1;
32 }
33  
34 2 1;
« FormValidator/Validator/Enum.pm ↑ Summary FormValidator/Validator/LengthMax.pm »