ExtDirect/Deserialize.pm

filter: Statementstmt 46.6% 14 / 30 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 0.0% 0 / 2 totaltotal 45.9% 17 / 37 CC 1 SCAR 3.4
CC
1
Cov
47%
decode_post
2.0
decode_form
2.0
BEGIN
1.0
CRAP 1.4
« ExtDirect/Exception.pm ↑ Summary ExtDirect/Request/PollHandler.pm »
1 #
2 # WARNING: This package is deprecated.
3 #
4 # See RPC::ExtDirect::Config perldoc for the description
5 # of the instance-based configuration options to be used
6 # instead of the former global variables in this package.
7 #
8  
9 package RPC::ExtDirect::Deserialize;
10  
11 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶no warnings 'uninitialized'; ## no critic
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 ### PACKAGE GLOBAL VARIABLE ###
16 #
17 # Set it to true value to turn on debugging
18 #
19 # DEPRECATED. Use `debug_deserialize` or `debug` Config options instead.
20 #
21  
22 1 our $DEBUG;
23  
24 ### PACKAGE GLOBAL VARIABLE ###
25 #
26 # Set Exception class name so it could be configured
27 #
28 # DEPRECATED. Use `exception_class_deserialize` or `exception_class`
29 # Config options instead.
30 #
31  
32 1 our $EXCEPTION_CLASS;
33  
34 ### PACKAGE GLOBAL VARIABLE ###
35 #
36 # Set Request class name so it could be configured
37 #
38 # DEPRECATED. Use `request_class_deserialize` or `request_class`
39 # Config options instead.
40 #
41  
42 1 our $REQUEST_CLASS;
43  
44 ### PACKAGE GLOBAL VARIABLE ###
45 #
46 # JSON decoding options
47 #
48 # DEPRECATED. Use `json_options_deserialize` or `json_options`
49 # Config options instead.
50 #
51  
52 1 our %JSON_OPTIONS;
53  
54 ### PUBLIC CLASS METHOD ###
55 #
56 # Turns JSONified POST request(s) into array of instantiated
57 # RPC::ExtDirect::Request (Exception) objects. Returns reference
58 # to array.
59 #
60 # DEPRECATED. Use RPC::ExtDirect::Serializer->decode_post() instead.
61 #
62  
63 sub decode_post {
64 0 ▶ shift; # class name
Subroutine decode_post: not called CC=1 SCAR=6.9
Pod undocumented
65
66 0 my $post_text = shift;
67
68 0 warn __PACKAGE__.'->decode_post class method is deprecated; ' .
69 'use RPC::ExtDirect::Serializer->decode_post ' .
70 'instance method instead';
71
72 0 require RPC::ExtDirect::Config;
73 0 require RPC::ExtDirect::Serializer;
74
75 0 my $config = RPC::ExtDirect::Config->new();
76 0 my $serializer = RPC::ExtDirect::Serializer->new( config => $config );
77
78 0 return $serializer->decode_post(
79 data => $post_text,
80 @_
81 );
82 }
83  
84 ### PUBLIC CLASS METHOD ###
85 #
86 # Instantiates Request based on form submitted to ExtDirect handler
87 # Returns arrayref with single Request.
88 #
89 # DEPRECATED. Use RPC::ExtDirect::Serializer->decode_form() instead.
90 #
91  
92 sub decode_form {
93 0 ▶ shift; # class name
Subroutine decode_form: not called CC=1 SCAR=6.9
Pod undocumented
94
95 0 my $form_href = shift;
96
97 0 warn __PACKAGE__.'->decode_form class method is deprecated; ' .
98 'use RPC::ExtDirect::Serializer->decode_form ' .
99 'instance method instead';
100
101 0 require RPC::ExtDirect::Config;
102 0 require RPC::ExtDirect::Serializer;
103
104 0 my $config = RPC::ExtDirect::Config->new();
105 0 my $serializer = RPC::ExtDirect::Serializer->new( config => $config );
106
107 0 return $serializer->decode_form(
108 data => $form_href,
109 @_
110 );
111 }
112  
113 1 1;
« ExtDirect/Exception.pm ↑ Summary ExtDirect/Request/PollHandler.pm »