Dry/Types/Ref.pm

filter: Statementstmt 100% 25 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 14 / 14 Podpod 100% 10 / 10 totaltotal 100% 49 / 49 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Dry/Types/Object.pm ↑ Summary Dry/Types/String.pm »
1 #!/usr/bin/env perl
2 #*
3 #* Info: Ref types definitions module
4 #* Author: Pawel Guspiel (neo77) <neo@cpan.org>
5 #*
6 #* This module keeps validation functions. You can of course add your modules which uses this and will add additional checks
7 #* Build in types for Params::Dry
8 #*
9 package Params::Dry::Types::Ref;
10 {
11 4 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 4 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 4 ▶ use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 # --- version ---
16 4 our $VERSION = 1.20_01;
17  
18 #=------------------------------------------------------------------------ { use, constants }
19  
20 4 ▶ use Params::Dry::Types qw(:const);
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 #=------------------------------------------------------------------------ { module public functions }
23  
24 #=---------
25 # Scalar
26 #=---------
27 #* scalar type check
28 #* RETURN: PASS if test pass otherwise FAIL
29 sub Scalar {
30 2 ▶ Params::Dry::Types::Ref( $_[0], 'SCALAR' );
Subroutine Scalar: called CC=1 SCAR=0.0
Pod documented
31 } #+ end of: sub Scalar
32  
33 #=--------
34 # Array
35 #=--------
36 #* array type check
37 #* RETURN: PASS if test pass otherwise FAIL
38 sub Array {
39 7 ▶ Params::Dry::Types::Ref( $_[0], 'ARRAY' );
Subroutine Array: called CC=1 SCAR=0.0
Pod documented
40 } #+ end of: sub Array
41  
42 #=-------
43 # Hash
44 #=-------
45 #* hash type check
46 #* RETURN: PASS if test pass otherwise FAIL
47 sub Hash {
48 2 ▶ Params::Dry::Types::Ref( $_[0], 'HASH' );
Subroutine Hash: called CC=1 SCAR=0.0
Pod documented
49 } #+ end of: sub Hash
50  
51 #=-------
52 # Code
53 #=-------
54 #* code type check
55 #* RETURN: PASS if test pass otherwise FAIL
56 sub Code {
57 2 ▶ Params::Dry::Types::Ref( $_[0], 'CODE' );
Subroutine Code: called CC=1 SCAR=0.0
Pod documented
58 } #+ end of: sub Code
59  
60 #=-------
61 # Glob
62 #=-------
63 #* glob type check
64 #* RETURN: PASS if test pass otherwise FAIL
65 sub Glob {
66 1 ▶ Params::Dry::Types::Ref( $_[0], 'GLOB' );
Subroutine Glob: called CC=1 SCAR=0.0
Pod documented
67 } #+ end of: sub Glob
68  
69 #=-------
70 # Ref
71 #=-------
72 #* Ref to Ref type check
73 #* RETURN: PASS if test pass otherwise FAIL
74 sub Ref {
75 1 ▶ Params::Dry::Types::Ref( $_[0], 'REF' );
Subroutine Ref: called CC=1 SCAR=0.0
Pod documented
76 } #+ end of: sub Ref
77  
78 #=---------
79 # LValue
80 #=---------
81 #* lvalue type check
82 #* RETURN: PASS if test pass otherwise FAIL
83 sub LValue {
84 1 ▶ Params::Dry::Types::Ref( $_[0], 'LVALUE' );
Subroutine LValue: called CC=1 SCAR=0.0
Pod documented
85 } #+ end of: sub LValue
86  
87 #=---------
88 # Format
89 #=---------
90 #* format type check
91 #* RETURN: PASS if test pass otherwise FAIL
92 sub Format {
93 1 ▶ Params::Dry::Types::Ref( $_[0], 'FORMAT' );
Subroutine Format: called CC=1 SCAR=0.0
Pod documented
94 } #+ end of: sub Format
95  
96 #=----------
97 # VString
98 #=----------
99 #* glob type check
100 #* RETURN: PASS if test pass otherwise FAIL
101 sub VString {
102 1 ▶ Params::Dry::Types::Ref( $_[0], 'VSTRING' );
Subroutine VString: called CC=1 SCAR=0.0
Pod documented
103 } #+ end of: sub VString
104  
105 #=---------
106 # Regexp
107 #=---------
108 #* glob type check
109 #* RETURN: PASS if test pass otherwise FAIL
110 sub Regexp {
111 2 ▶ Params::Dry::Types::Ref( $_[0], 'Regexp' );
Subroutine Regexp: called CC=1 SCAR=0.0
Pod documented
112 } #+ end of: sub Regexp
113  
114 4 };
115 4 0115 && 0x4d;
116  
117 #+ End of Params::Dry::Types::Ref
118 __END__
« Dry/Types/Object.pm ↑ Summary Dry/Types/String.pm »