Widget/Constraint/All.pm untested

filter: Statementstmt 0.0% 0 / 16 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 35 CC 3 SCAR 19.5
CC
3
Cov
0%
process
12.0
BEGIN
2.0
BEGIN
2.0
CRAP 7.0
1 package HTML::Widget::Constraint::All;
2  
3 use warnings;
4 use strict;
5 use base 'HTML::Widget::Constraint';
6  
7 =head1 NAME
8  
9 HTML::Widget::Constraint::All - All Constraint
10  
11 =head1 SYNOPSIS
12  
13 my $c = $widget->constraint( 'All', 'foo', 'bar' );
14  
15 =head1 DESCRIPTION
16  
17 All named fields are required.
18  
19 =head1 METHODS
20  
21 =head2 process
22  
23 =cut
24  
25 sub process {
26 my ( $self, $w, $params ) = @_;
27 my $results = [];
28 for my $name ( @{ $self->names } ) {
29 push @$results,
30 HTML::Widget::Error->new(
31 { name => $name, message => $self->mk_message } )
32 if $self->not
33 ? ( defined $params->{$name} && length $params->{$name} )
34 : ( !defined $params->{$name} || !length( $params->{$name} ) );
35 }
36 return $results;
37 }
38  
39 =head1 AUTHOR
40  
41 Sebastian Riedel, C<sri@oook.de>
42  
43 =head1 LICENSE
44  
45 This library is free software, you can redistribute it and/or modify it under
46 the same terms as Perl itself.
47  
48 =cut
49  
50 1;