| 1 | package Amon2::Plugin::Web::FillInForm; | ||||||||||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use 5.008001; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 1 | our $VERSION = '0.02'; | |||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 1 | ▶ | use HTML::FillInForm; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 0 | ▶ | sub init { | ||||||||||||||||||
|
Subroutine
init: not called CC=2 SCAR=13.4
Pod
undocumented
| |||||||||||||||||||||
| 10 | 0 | my ($class, $c, $conf) = @_; | |||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 1 | ▶ | no strict 'refs'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 0 | ▶ | my $klass = ref $c || $c; | ||||||||||||||||||
|
Condition0%0/3
ref $c || $c
MC/DC0%0/2
ref $c || $c
ref $c
$c
Truth table0%0/3
A || B
A= ref $cB= $c
| |||||||||||||||||||||
| 15 | 0 | *{"$klass\::fillin_form"} = \&_fillin_form2; | |||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 0 | my $response_class = ref $c->create_response(); | |||||||||||||||||||
| 18 | 0 | *{"$response_class\::fillin_form"} = \&_fillin_form; | |||||||||||||||||||
| 19 | } | ||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 0 | ▶ | sub _fillin_form2 { | ||||||||||||||||||
|
Subroutine
_fillin_form2: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 22 | 0 | my ($self, @stuff) = @_; | |||||||||||||||||||
| 23 | $self->add_trigger( | ||||||||||||||||||||
| 24 | 0 | ▶ | 'HTML_FILTER' => sub { | ||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 25 | 0 | my ($c, $html) = @_; | |||||||||||||||||||
| 26 | 0 | return HTML::FillInForm->fill(\$html, @stuff); | |||||||||||||||||||
| 27 | }, | ||||||||||||||||||||
| 28 | 0 | ); | |||||||||||||||||||
| 29 | } | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | # DEPRECATED interface | ||||||||||||||||||||
| 32 | 0 | ▶ | sub _fillin_form { | ||||||||||||||||||
|
Subroutine
_fillin_form: not called CC=2 SCAR=17.9
| |||||||||||||||||||||
| 33 | 0 | my ($self, @stuff) = @_; | |||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | 0 | Carp::cluck("\$res->fillin_form() was deprecated. Use \$c->fillin_form(\$stuff) instead."); | |||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | 0 | my $html = $self->body(); | |||||||||||||||||||
| 38 | 0 | my $output = HTML::FillInForm->fill(\$html, @stuff); | |||||||||||||||||||
| 39 | 0 | $self->body($output); | |||||||||||||||||||
| 40 | 0 | ▶ | $self->header('Content-Length' => length($output)) if $self->header('Content-Length'); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 41 | 0 | return $self; | |||||||||||||||||||
| 42 | } | ||||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | 1 | 1; | |||||||||||||||||||
| 47 | __END__ | ||||||||||||||||||||