blib/lib/BZ/Client/XMLRPC/Array.pm

filter: Statementstmt 33.3% 11 / 33 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 42.8% 3 / 7 Podpod 0.0% 0 / 3 totaltotal 25.4% 14 / 55 CC 7 SCAR 34.3
CC
7
Cov
24%
start
56.0
init
2.0
__ANON__
2.0
CRAP 30.8
« blib/lib/BZ/Client/XMLRPC/Struct.pm ↑ Summary blib/lib/BZ/Client.pm »
1 #!/bin/false
2 # PODNAME: BZ::Client::XMLRPC::Array
3 # ABSTRACT: Event handler for parsing a single XML-RPC array.
4  
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 package BZ::Client::XMLRPC::Array;
9 1 $BZ::Client::XMLRPC::Array::VERSION = '4.9';
10 1 ▶use parent qw(BZ::Client::XMLRPC::Handler);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 sub init {
13 0 ▶ my($self,$parser) = @_;
Subroutine init: not called CC=1 SCAR=6.9
Pod undocumented
14 0 $self->SUPER::init($parser);
15 0 $self->{'result'} = []
16 }
17  
18 sub start {
19 0 ▶ my($self,$name) = @_;
Subroutine start: not called CC=7 SCAR=40.3
Pod undocumented
20 0 my $l = $self->inc_level();
21 0 ▶ if ($l == 0) {
Branch: 3 branches
BranchTrueFalseTotal
if ($l == 0) { } 0 0 0
elsif ($l == 1) { } 0 0 0
elsif ($l == 2) { } 0 0 0
22 0 ▶ if ('array' ne $name) {
Branch: 1 branch
BranchTrueFalseTotal
if ("array" ne $name) 0 0 0
23 0 $self->error("Expected array element, got $name");
24 }
25 }
26 elsif ($l == 1) {
27 0 ▶ if ('data' ne $name) {
Branch: 1 branch
BranchTrueFalseTotal
if ("data" ne $name) 0 0 0
28 0 $self->error("Expected array/data element, got $name");
29 }
30 }
31 elsif ($l == 2) {
32 0 ▶ if ('value' eq $name) {
Branch: 1 branch
BranchTrueFalseTotal
if ('value' eq $name) { } 0 0 0
33 0 my $handler = BZ::Client::XMLRPC::Value->new();
34 $self->parser()->register($self, $handler, sub {
35 0 ▶ my $array = $self->{'result'};
Subroutine __ANON__: not called CC=1 SCAR=6.9
36 0 push(@$array, $handler->result());
37 0 $array;
38 0 });
39 0 $handler->start($name);
40 }
41 else {
42 0 $self->error("Expected array/data/value, got $name");
43 }
44 }
45 else {
46 0 $self->error("Unexpected level $l with element $name");
47 }
48 0 return $l
49 }
50  
51 sub result {
52 0 ▶ my $self = shift;
Subroutine result: not called CC=1 SCAR=6.9
Pod undocumented
53 0 return $self->{'result'}
54 }
55  
56 1 1;
57  
58 __END__
59  
60 =pod
61  
62 =encoding UTF-8
63  
64 =head1 NAME
65  
66 BZ::Client::XMLRPC::Array - Event handler for parsing a single XML-RPC array.
67  
68 =head1 VERSION
69  
70 version 4.9
71  
72 =head1 AUTHORS
73  
74 =over 4
75  
76 =item *
77  
78 Dean Hamstead <dean@bytefoundry.com.au>
79  
80 =item *
81  
82 Jochen Wiedmann <jochen.wiedmann@gmail.com>
83  
84 =back
85  
86 =head1 COPYRIGHT AND LICENSE
87  
88 This software is copyright (c) 2026 by Dean Hamstad.
89  
90 This is free software; you can redistribute it and/or modify it under
91 the same terms as the Perl 5 programming language system itself.
92  
93 =cut
« blib/lib/BZ/Client/XMLRPC/Struct.pm ↑ Summary blib/lib/BZ/Client.pm »