| 1 | package HTTP::AnyUA::Middleware; | ||||||||||
| 2 | # ABSTRACT: A base class for HTTP::AnyUA middleware | ||||||||||
| 3 | |||||||||||
| 4 | |||||||||||
| 5 | 7 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 7 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 7 | our $VERSION = '0.904'; # VERSION | |||||||||
| 9 | |||||||||||
| 10 | 0 | ▶ | sub _croak { require Carp; Carp::croak(@_) } | ||||||||
|
Subroutine
_croak: not called CC=1 SCAR=6.9
| |||||||||||
| 11 | 0 | ▶ | sub _usage { _croak("Usage: @_\n") } | ||||||||
|
Subroutine
_usage: not called CC=1 SCAR=6.9
| |||||||||||
| 12 | |||||||||||
| 13 | |||||||||||
| 14 | |||||||||||
| 15 | 4 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 16 | 4 | my $class = shift; | |||||||||
| 17 | 4 | ▶ | my $backend = shift or die 'Backend is required'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 4 | my $self = bless {backend => $backend}, $class; | |||||||||
| 19 | 4 | $self->init(@_); | |||||||||
| 20 | 4 | return $self; | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | |||||||||||
| 24 | 2 | ▶ | sub init {} | ||||||||
|
Subroutine
init: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 25 | |||||||||||
| 26 | |||||||||||
| 27 | 4 | ▶ | sub wrap { | ||||||||
|
Subroutine
wrap: called CC=3 SCAR=11.8
Pod
documented
| |||||||||||
| 28 | 4 | my $self = shift; | |||||||||
| 29 | 4 | ▶ | my $backend = shift or _usage($self . q{->wrap($backend, %args)}); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | |||||||||||
| 31 | 4 | ▶ | if (ref $self) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 0 | $self->{backend} = $backend; | |||||||||
| 33 | } | ||||||||||
| 34 | else { | ||||||||||
| 35 | 4 | $self = $self->new($backend, @_); | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | 4 | return $self; | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | |||||||||||
| 42 | 0 | ▶ | sub request { shift->backend->request(@_) } | ||||||||
|
Subroutine
request: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 43 | |||||||||||
| 44 | |||||||||||
| 45 | 27 | ▶ | sub backend { shift->{backend} } | ||||||||
|
Subroutine
backend: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 46 | |||||||||||
| 47 | |||||||||||
| 48 | 0 | ▶ | sub ua { shift->backend->ua(@_) } | ||||||||
|
Subroutine
ua: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 49 | |||||||||||
| 50 | |||||||||||
| 51 | 19 | ▶ | sub response_is_future { shift->backend->response_is_future(@_) } | ||||||||
|
Subroutine
response_is_future: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 52 | |||||||||||
| 53 | 7 | 1; | |||||||||
| 54 | |||||||||||
| 55 | __END__ | ||||||||||