| 1 | package CGI::Builder::DFVCheck ; | ||||||||||||||||||||||||||||
| 2 | 2 | $VERSION = 1.28 ; | |||||||||||||||||||||||||||
| 3 | 2 | ▶ | use strict ; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | # This file uses the "Perlish" coding style | ||||||||||||||||||||||||||||
| 6 | # please read http://perl.4pro.net/perlish_coding_style.html | ||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | ; use Carp | ||||||||||||||||||||||||||||
| 9 | 2 | ▶ | ; $Carp::Internal{+__PACKAGE__}++ | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 2 | ▶ | ; use Object::groups qw | dfv_defaults | | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 2 | ; use Object::props | |||||||||||||||||||||||||||
| 13 | 2 | ▶ | ( { name => 'dfv_results' | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | , allowed => qr /::dfv_check$/ | ||||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||
| 16 | ) | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 2 | ; sub dfv_new | |||||||||||||||||||||||||||
| 19 | 2 | ▶ | { require Data::FormValidator | ||||||||||||||||||||||||||
|
Subroutine
dfv_new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 20 | 2 | ; $Carp::Internal{'Data::FormValidator'}++ | |||||||||||||||||||||||||||
| 21 | 2 | ; Data::FormValidator->new( {} | |||||||||||||||||||||||||||
| 22 | , scalar $_[0]->dfv_defaults | ||||||||||||||||||||||||||||
| 23 | ) | ||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | ; sub dfv_check | ||||||||||||||||||||||||||||
| 27 | 2 | ▶ | { my ($s, $profile) = @_ | ||||||||||||||||||||||||||
|
Subroutine
dfv_check: called CC=5 SCAR=17.3
Pod
documented
| |||||||||||||||||||||||||||||
| 28 | 2 | ▶ | ; $profile || croak 'Missing required profile' | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 29 | 2 | ▶ | ; $profile = $s->$profile() | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 30 | unless ref $profile eq 'HASH' | ||||||||||||||||||||||||||||
| 31 | 2 | ; my $r = $s->dfv_new->check( $s->cgi, $profile ) | |||||||||||||||||||||||||||
| 32 | 2 | ; $s->dfv_results($r) | |||||||||||||||||||||||||||
| 33 | ; ( $r->has_missing || $r->has_invalid ) | ||||||||||||||||||||||||||||
| 34 | 2 | ▶ | ? do{ $s->page_error($r->msgs); 0 } | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$r->has_missing or $r->has_invalid
MC/DC0%0/2
$r->has_missing or $r->has_invalid
$r->has_missing
$r->has_invalid
Truth table33%1/3
A or B
A= $r->has_missingB= $r->has_invalid
| |||||||||||||||||||||||||||||
| 35 | : 1 | ||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 2 | ; 1 | |||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | __END__ | ||||||||||||||||||||||||||||