blib/lib/SOAP/WSDL/XSD/Typelib/Builtin/anyType.pm

filter: Statementstmt 100% 31 / 31 Branchbran 86.3% 19 / 22 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 11 / 11 Podpod 0.0% 0 / 6 totaltotal 87.1% 61 / 70 CC 12 SCAR 15.9
CC
12
Cov
94%
start_tag
9.2
end_tag
4.0
BEGIN
1.0
CRAP 4.9
« blib/lib/SOAP/WSDL/Server/CGI.pm ↑ Summary blib/lib/SOAP/WSDL/Serializer/XSD.pm »
1 package SOAP::WSDL::XSD::Typelib::Builtin::anyType;
2 84 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 84 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 84 ▶use Class::Std::Fast::Storable constructor => 'none';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 84 our $VERSION = 3.004;
7  
8 11 ▶sub get_xmlns { 'http://www.w3.org/2001/XMLSchema' };
Subroutine get_xmlns: called CC=1 SCAR=0.0
Pod undocumented
9  
10 # start_tag creates a XML start tag either for a XML element or a attribute.
11 # The method is highly optimized for performance:
12 # - operates on @_
13 # - uses no private variables
14 # - uses no blocks
15  
16 134 ▶sub start_tag {
Subroutine start_tag: called CC=9 SCAR=22.2
Pod undocumented
17 # return empty string if no second argument ($opt) or no name
18 134 ▶ return q{} if (! $#_);
Branch: 1 branch
BranchTrueFalseTotal
unless $#_ 1 133 134
19 133 ▶ return q{} if (! exists $_[1]->{ name });
Branch: 1 branch
BranchTrueFalseTotal
unless exists $_[1]{"name"} 82 51 133
20 # return attribute start if it's an attribute
21 51 ▶ return qq{ $_[1]->{name}="} if $_[1]->{ attr };
Branch: 1 branch
BranchTrueFalseTotal
if $_[1]{"attr"} 4 47 51
22 # return with xsi:nil="true" if it is nil
23 return join
24 q{} ,
25 "<$_[1]->{ name }" ,
26 (defined $_[1]->{ xmlns }) ? qq{ xmlns="$_[1]->{ xmlns }"} : (),
27 $_[0]->serialize_attr($_[1]) ,
28 q{ xsi:nil="true"/>}
29 47 ▶ if ($_[1]->{ nil });
Branch: 2 branches
BranchTrueFalseTotal
if $_[1]{"nil"} 1 46 47
defined $_[1]{'xmlns'} ? : 0 1 1
30 # return "empty" start tag if it's empty
31 return join
32 q{},
33 "<$_[1]->{ name }",
34 (defined $_[1]->{ xmlns }) ? qq{ xmlns="$_[1]->{ xmlns }"} : (),
35 $_[0]->serialize_attr($_[1]) ,
36 '/>'
37 46 ▶ if ($_[1]->{ empty });
Branch: 2 branches
BranchTrueFalseTotal
if $_[1]{"empty"} 2 44 46
defined $_[1]{'xmlns'} ? : 0 2 2
38 # return XML element start tag
39 return join
40 q{},
41 "<$_[1]->{ name }",
42 44 ▶ (defined $_[1]->{ xmlns }) ? qq{ xmlns="$_[1]->{ xmlns }"} : (),
Branch: 1 branch
BranchTrueFalseTotal
defined $_[1]{'xmlns'} ? : 0 44 44
43 , $_[0]->serialize_attr($_[1])
44 , '>';
45 }
46  
47 # start_tag creates a XML end tag either for a XML element or a attribute.
48 # The method is highly optimized for performance:
49 # - operates on @_
50 # - uses no private variables
51 # - uses no blocks
52 122 ▶sub end_tag {
Subroutine end_tag: called CC=4 SCAR=13.9
Pod undocumented
53 # return empty string if no second argument ($opt) or no name
54 122 ▶ return q{} if (! $#_);
Branch: 1 branch
BranchTrueFalseTotal
unless $#_ 12 110 122
55 110 ▶ return q{} if (! exists $_[1]->{ name });
Branch: 1 branch
BranchTrueFalseTotal
unless exists $_[1]{"name"} 63 47 110
56 47 ▶ return q{"} if $_[1]->{ attr };
Branch: 1 branch
BranchTrueFalseTotal
if $_[1]{"attr"} 4 43 47
57 43 return "</$_[1]->{name}>";
58 };
59  
60 59 ▶sub serialize_attr {};
Subroutine serialize_attr: called CC=1 SCAR=0.0
Pod undocumented
61  
62 # sub serialize { q{} };
63  
64 19 ▶sub serialize_qualified :STRINGIFY {
Subroutine serialize_qualified: called CC=1 SCAR=0.0
Pod undocumented
65 19 return $_[0]->serialize( { qualified => 1 } );
66 84 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
67  
68 2 ▶sub as_list :ARRAYIFY {
Subroutine as_list: called CC=1 SCAR=0.0
Pod undocumented
69 2 return [ $_[0] ];
70 84 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
71  
72 84 Class::Std::initialize(); # make :STRINGIFY overloading work
73  
74 84 1;
75  
« blib/lib/SOAP/WSDL/Server/CGI.pm ↑ Summary blib/lib/SOAP/WSDL/Serializer/XSD.pm »