| 1 | #!/bin/false | ||||||||||||||||||||
| 2 | # PODNAME: BZ::Client::XMLRPC::Handler | ||||||||||||||||||||
| 3 | # ABSTRACT: Abstract event handler for parsing an XML-RPC response. | ||||||||||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 1 | ▶ | use warnings 'all'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | package BZ::Client::XMLRPC::Handler; | ||||||||||||||||||||
| 8 | 1 | $BZ::Client::XMLRPC::Handler::VERSION = '4.4001'; | |||||||||||||||||||
| 9 | sub new { | ||||||||||||||||||||
| 10 | 0 | ▶ | my $class = shift; | ||||||||||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 11 | 0 | my $self = { @_ }; | |||||||||||||||||||
| 12 | 0 | $self->{'level'} = 0; | |||||||||||||||||||
| 13 | 0 | ▶ | bless($self, ref($class) || $class); | ||||||||||||||||||
|
Condition0%0/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table0%0/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||
| 14 | 0 | return $self | |||||||||||||||||||
| 15 | } | ||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | sub init { | ||||||||||||||||||||
| 18 | 0 | ▶ | my($self,$parser) = @_; | ||||||||||||||||||
|
Subroutine
init: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 19 | 0 | $self->parser($parser); | |||||||||||||||||||
| 20 | } | ||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | sub parser { | ||||||||||||||||||||
| 23 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
parser: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 24 | 0 | ▶ | if (@_) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 25 | 0 | $self->{'parser'} = shift; | |||||||||||||||||||
| 26 | } else { | ||||||||||||||||||||
| 27 | 0 | return $self->{'parser'}; | |||||||||||||||||||
| 28 | } | ||||||||||||||||||||
| 29 | } | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | sub level { | ||||||||||||||||||||
| 32 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
level: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 33 | 0 | ▶ | if (@_) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 34 | 0 | $self->{'level'} = shift; | |||||||||||||||||||
| 35 | } else { | ||||||||||||||||||||
| 36 | 0 | return $self->{'level'}; | |||||||||||||||||||
| 37 | } | ||||||||||||||||||||
| 38 | } | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | sub inc_level { | ||||||||||||||||||||
| 41 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
inc_level: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 42 | 0 | my $res = $self->{'level'}++; | |||||||||||||||||||
| 43 | 0 | return $res | |||||||||||||||||||
| 44 | } | ||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | sub dec_level { | ||||||||||||||||||||
| 47 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
dec_level: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 48 | 0 | my $res = --$self->{'level'}; | |||||||||||||||||||
| 49 | 0 | return $res | |||||||||||||||||||
| 50 | } | ||||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | sub error { | ||||||||||||||||||||
| 53 | 0 | ▶ | my($self, $msg) = @_; | ||||||||||||||||||
|
Subroutine
error: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 54 | 0 | $self->parser()->error($msg); | |||||||||||||||||||
| 55 | } | ||||||||||||||||||||
| 56 | |||||||||||||||||||||
| 57 | sub characters { | ||||||||||||||||||||
| 58 | 0 | ▶ | my($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
characters: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 59 | 0 | ▶ | if ($text !~ /^\s*$/s) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 60 | 0 | $self->error("Unexpected non-whitespace: $text"); | |||||||||||||||||||
| 61 | } | ||||||||||||||||||||
| 62 | } | ||||||||||||||||||||
| 63 | |||||||||||||||||||||
| 64 | sub end { | ||||||||||||||||||||
| 65 | # my($self,$name) = @_; | ||||||||||||||||||||
| 66 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
end: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 67 | 0 | my $l = $self->dec_level(); | |||||||||||||||||||
| 68 | 0 | ▶ | if ($l == 0) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 69 | 0 | $self->parser()->remove($self); | |||||||||||||||||||
| 70 | } | ||||||||||||||||||||
| 71 | 0 | return $l | |||||||||||||||||||
| 72 | } | ||||||||||||||||||||
| 73 | |||||||||||||||||||||
| 74 | 1 | 1; | |||||||||||||||||||
| 75 | |||||||||||||||||||||
| 76 | __END__ | ||||||||||||||||||||
| 77 | |||||||||||||||||||||
| 78 | =pod | ||||||||||||||||||||
| 79 | |||||||||||||||||||||
| 80 | =encoding UTF-8 | ||||||||||||||||||||
| 81 | |||||||||||||||||||||
| 82 | =head1 NAME | ||||||||||||||||||||
| 83 | |||||||||||||||||||||
| 84 | BZ::Client::XMLRPC::Handler - Abstract event handler for parsing an XML-RPC response. | ||||||||||||||||||||
| 85 | |||||||||||||||||||||
| 86 | =head1 VERSION | ||||||||||||||||||||
| 87 | |||||||||||||||||||||
| 88 | version 4.4001 | ||||||||||||||||||||
| 89 | |||||||||||||||||||||
| 90 | =head1 AUTHORS | ||||||||||||||||||||
| 91 | |||||||||||||||||||||
| 92 | =over 4 | ||||||||||||||||||||
| 93 | |||||||||||||||||||||
| 94 | =item * | ||||||||||||||||||||
| 95 | |||||||||||||||||||||
| 96 | Dean Hamstead <dean@bytefoundry.com.au> | ||||||||||||||||||||
| 97 | |||||||||||||||||||||
| 98 | =item * | ||||||||||||||||||||
| 99 | |||||||||||||||||||||
| 100 | Jochen Wiedmann <jochen.wiedmann@gmail.com> | ||||||||||||||||||||
| 101 | |||||||||||||||||||||
| 102 | =back | ||||||||||||||||||||
| 103 | |||||||||||||||||||||
| 104 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||
| 105 | |||||||||||||||||||||
| 106 | This software is copyright (c) 2017 by Dean Hamstad. | ||||||||||||||||||||
| 107 | |||||||||||||||||||||
| 108 | This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||
| 109 | the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||
| 110 | |||||||||||||||||||||
| 111 | =cut | ||||||||||||||||||||