| 1 | package Catalyst::Plugin::FormValidator::Simple; | ||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use base qw/Catalyst::Plugin::FormValidator/; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | # doesn't use parent module at all, but this is required for Catalyst::Plugin::FillInForm | ||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use MRO::Compat; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 1 | require FormValidator::Simple; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 1 | our $VERSION = '0.15'; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 0 | ▶ | sub setup { | ||||||||||||||||||||||||||
|
Subroutine
setup: not called CC=11 SCAR=48.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 12 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 13 | 0 | $self->maybe::next::method(@_); | |||||||||||||||||||||||||||
| 14 | 0 | my $setting = $self->config->{validator}; | |||||||||||||||||||||||||||
| 15 | my $plugins = $setting && exists $setting->{plugins} | ||||||||||||||||||||||||||||
| 16 | ? $setting->{plugins} | ||||||||||||||||||||||||||||
| 17 | 0 | ▶ | : []; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$setting and exists $setting->{"plugins"}
MC/DC0%0/2
$setting and exists $setting->{"plugins"}
$setting
exists $setting->{"plugins"}
Truth table0%0/3
A and B
A= $settingB= exists $setting->{"plugins"}
| |||||||||||||||||||||||||||||
| 18 | 0 | FormValidator::Simple->import(@$plugins); | |||||||||||||||||||||||||||
| 19 | 0 | ▶ | if ( $setting && exists $setting->{messages} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$setting and exists $setting->{"messages"}
MC/DC0%0/2
$setting and exists $setting->{"messages"}
$setting
exists $setting->{"messages"}
Truth table0%0/3
A and B
A= $settingB= exists $setting->{"messages"}
| |||||||||||||||||||||||||||||
| 20 | 0 | FormValidator::Simple->set_messages( $setting->{messages} ); | |||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | 0 | ▶ | if ( $setting && exists $setting->{options} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$setting and exists $setting->{"options"}
MC/DC0%0/2
$setting and exists $setting->{"options"}
$setting
exists $setting->{"options"}
Truth table0%0/3
A and B
A= $settingB= exists $setting->{"options"}
| |||||||||||||||||||||||||||||
| 23 | 0 | FormValidator::Simple->set_option( %{ $setting->{options} } ); | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | 0 | ▶ | if ( $setting && exists $setting->{message_format} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$setting and exists $setting->{"message_format"}
MC/DC0%0/2
$setting and exists $setting->{"message_format"}
$setting
exists $setting->{"message_format"}
Truth table0%0/3
A and B
A= $settingB= exists $setting->{"message_format"}
| |||||||||||||||||||||||||||||
| 26 | 0 | FormValidator::Simple->set_message_format( $setting->{message_format} ); | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | 0 | ▶ | if ( $setting && exists $setting->{message_decode_from} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$setting and exists $setting->{"message_decode_from"}
MC/DC0%0/2
$setting and exists $setting->{"message_decode_from"}
$setting
exists $setting->{"message_decode_from"}
Truth table0%0/3
A and B
A= $settingB= exists $setting->{"message_decode_from"}
| |||||||||||||||||||||||||||||
| 29 | 0 | FormValidator::Simple->set_message_decode_from( $setting->{message_decode_from} ); | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 0 | ▶ | sub prepare { | ||||||||||||||||||||||||||
|
Subroutine
prepare: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 34 | 0 | my $c = shift; | |||||||||||||||||||||||||||
| 35 | 0 | $c = $c->maybe::next::method(@_); | |||||||||||||||||||||||||||
| 36 | 0 | $c->{validator} = FormValidator::Simple->new; | |||||||||||||||||||||||||||
| 37 | 0 | return $c; | |||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 0 | ▶ | sub form { | ||||||||||||||||||||||||||
|
Subroutine
form: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 41 | 0 | my $c = shift; | |||||||||||||||||||||||||||
| 42 | 0 | ▶ | if ($_[0]) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 43 | 0 | ▶ | my $form = $_[1] ? [@_] : $_[0]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 44 | 0 | $c->{validator}->check($c->req, $form); | |||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | 0 | return $c->{validator}->results; | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | 0 | ▶ | sub set_invalid_form { | ||||||||||||||||||||||||||
|
Subroutine
set_invalid_form: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 50 | 0 | my $c = shift; | |||||||||||||||||||||||||||
| 51 | 0 | $c->{validator}->set_invalid(@_); | |||||||||||||||||||||||||||
| 52 | 0 | return $c->{validator}->results; | |||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 1 | 1; | |||||||||||||||||||||||||||
| 56 | __END__ | ||||||||||||||||||||||||||||