Parser/FormValidator.pm untested

filter: Statementstmt 0.0% 0 / 17 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 23 CC 2 SCAR 13.9
CC
2
Cov
0%
parse
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 4.0
1 package Message::Stack::FormValidator;
2 {
3 $Message::Stack::FormValidator::VERSION = '0.06';
4 }
5 use Moose;
6  
7 use Message::Stack::Message;
8  
9 sub parse {
10 my ($stack, $scope, $results) = @_;
11  
12 if($results->success) {
13 return 1;
14 }
15  
16 foreach my $f ($results->missing) {
17 $stack->add(Message::Stack::Message->new(
18 id => "missing_$f",
19 scope => $scope,
20 subject => $f,
21 level => 'error'
22 ));
23 }
24  
25 foreach my $f ($results->invalid) {
26 $stack->add(Message::Stack::Message->new(
27 id => "invalid_$f",
28 scope => $scope,
29 subject => $f,
30 level => 'error'
31 ));
32 }
33  
34 return 0;
35 }
36  
37 1;
38  
39 __END__