line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Params::Validate; |
2
|
|
|
|
|
|
|
|
3
|
34
|
|
|
34
|
|
325368
|
use 5.008001; |
|
34
|
|
|
|
|
139
|
|
4
|
|
|
|
|
|
|
|
5
|
34
|
|
|
34
|
|
200
|
use strict; |
|
34
|
|
|
|
|
78
|
|
|
34
|
|
|
|
|
809
|
|
6
|
34
|
|
|
34
|
|
187
|
use warnings; |
|
34
|
|
|
|
|
80
|
|
|
34
|
|
|
|
|
1501
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '1.29'; |
9
|
|
|
|
|
|
|
|
10
|
34
|
|
|
34
|
|
213
|
use Exporter; |
|
34
|
|
|
|
|
85
|
|
|
34
|
|
|
|
|
1530
|
|
11
|
34
|
|
|
34
|
|
15791
|
use Module::Implementation; |
|
34
|
|
|
|
|
174381
|
|
|
34
|
|
|
|
|
1130
|
|
12
|
34
|
|
|
34
|
|
14031
|
use Params::Validate::Constants; |
|
34
|
|
|
|
|
113
|
|
|
34
|
|
|
|
|
3204
|
|
13
|
|
|
|
|
|
|
|
14
|
34
|
|
|
34
|
|
232
|
use vars qw( $NO_VALIDATION %OPTIONS $options ); |
|
34
|
|
|
|
|
79
|
|
|
34
|
|
|
|
|
7221
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our @ISA = 'Exporter'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my @types = qw( |
19
|
|
|
|
|
|
|
SCALAR |
20
|
|
|
|
|
|
|
ARRAYREF |
21
|
|
|
|
|
|
|
HASHREF |
22
|
|
|
|
|
|
|
CODEREF |
23
|
|
|
|
|
|
|
GLOB |
24
|
|
|
|
|
|
|
GLOBREF |
25
|
|
|
|
|
|
|
SCALARREF |
26
|
|
|
|
|
|
|
HANDLE |
27
|
|
|
|
|
|
|
BOOLEAN |
28
|
|
|
|
|
|
|
UNDEF |
29
|
|
|
|
|
|
|
OBJECT |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
33
|
|
|
|
|
|
|
'all' => [ |
34
|
|
|
|
|
|
|
qw( validate validate_pos validation_options validate_with ), |
35
|
|
|
|
|
|
|
@types |
36
|
|
|
|
|
|
|
], |
37
|
|
|
|
|
|
|
types => \@types, |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{all} }, 'set_options' ); |
41
|
|
|
|
|
|
|
our @EXPORT = qw( validate validate_pos ); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
$NO_VALIDATION = $ENV{PERL_NO_VALIDATION}; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
{ |
46
|
|
|
|
|
|
|
my $loader = Module::Implementation::build_loader_sub( |
47
|
|
|
|
|
|
|
implementations => [ 'XS', 'PP' ], |
48
|
|
|
|
|
|
|
symbols => [ |
49
|
|
|
|
|
|
|
qw( |
50
|
|
|
|
|
|
|
validate |
51
|
|
|
|
|
|
|
validate_pos |
52
|
|
|
|
|
|
|
validate_with |
53
|
|
|
|
|
|
|
validation_options |
54
|
|
|
|
|
|
|
set_options |
55
|
|
|
|
|
|
|
), |
56
|
|
|
|
|
|
|
], |
57
|
|
|
|
|
|
|
); |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
$ENV{PARAMS_VALIDATE_IMPLEMENTATION} = 'PP' if $ENV{PV_TEST_PERL}; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
$loader->(); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
# ABSTRACT: Validate method/function parameters |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__ |