line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Params::Validate; |
2
|
|
|
|
|
|
|
|
3
|
34
|
|
|
34
|
|
756380
|
use 5.008001; |
|
34
|
|
|
|
|
365
|
|
4
|
|
|
|
|
|
|
|
5
|
34
|
|
|
34
|
|
185
|
use strict; |
|
34
|
|
|
|
|
68
|
|
|
34
|
|
|
|
|
767
|
|
6
|
34
|
|
|
34
|
|
164
|
use warnings; |
|
34
|
|
|
|
|
69
|
|
|
34
|
|
|
|
|
1692
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '1.31'; |
9
|
|
|
|
|
|
|
|
10
|
34
|
|
|
34
|
|
228
|
use Exporter; |
|
34
|
|
|
|
|
65
|
|
|
34
|
|
|
|
|
1473
|
|
11
|
34
|
|
|
34
|
|
16531
|
use Module::Implementation; |
|
34
|
|
|
|
|
203912
|
|
|
34
|
|
|
|
|
1076
|
|
12
|
34
|
|
|
34
|
|
13633
|
use Params::Validate::Constants; |
|
34
|
|
|
|
|
87
|
|
|
34
|
|
|
|
|
3312
|
|
13
|
|
|
|
|
|
|
|
14
|
34
|
|
|
34
|
|
244
|
use vars qw( $NO_VALIDATION %OPTIONS $options ); |
|
34
|
|
|
|
|
70
|
|
|
34
|
|
|
|
|
8591
|
|
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__ |