lib/HTML/FormFu/QueryType/CGI/Simple.pm

filter: Statementstmt 37.0% 10 / 27 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod 50.0% 1 / 2 totaltotal 33.3% 13 / 39 CC 5 SCAR 29.6
CC
5
Cov
30%
parse_uploads
30.0
fh
2.0
BEGIN
1.0
CRAP 19.2
« lib/HTML/FormFu/Role/Constraint/Others.pm ↑ Summary lib/HTML/FormFu/Role/Element/Group.pm »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 package HTML::FormFu::QueryType::CGI::Simple;
4 1 $HTML::FormFu::QueryType::CGI::Simple::VERSION = '2.09';
5 # ABSTRACT: uploaded file
6  
7 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 extends 'HTML::FormFu::QueryType::CGI';
10  
11 0 ▶sub parse_uploads {
Subroutine parse_uploads: not called CC=5 SCAR=34.0
Pod undocumented
12 0 my ( $class, $form, $name ) = @_;
13  
14 0 my $query = $form->query;
15 0 my @params = $query->param($name);
16 0 my @new;
17  
18 0 for my $param (@params) {
19 0 ▶ if ( my $file = $query->upload($param) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $file = $query->upload($param)) 0 0 0
20 0 my $filename = $param;
21  
22 0 $param = $class->new(
23 { _param => $file,
24 filename => $filename,
25 parent => $form,
26 } );
27  
28 0 my $headers = HTTP::Headers->new(
29 'Content-Type' => $query->upload_info( $filename, 'mime' ),
30 'Content-Length' => $query->upload_info( $filename, 'size' ),
31 );
32  
33 0 $param->headers($headers);
34 0 $param->size( $headers->content_length );
35 0 $param->type( $headers->content_type );
36 }
37 0 push @new, $param;
38 }
39  
40 0 ▶ return if !@new;
Branch: 1 branch
BranchTrueFalseTotal
unless @new 0 0 0
41  
42 0 ▶ return @new == 1 ? $new[0] : \@new;
Branch: 1 branch
BranchTrueFalseTotal
@new == 1 ? : 0 0 0
43 }
44  
45 0 ▶sub fh {
Subroutine fh: not called CC=1 SCAR=6.9
Pod documented
46 0 my ($self) = @_;
47  
48 0 return $self->form->query->upload( $self->filename );
49 }
50  
51 1 __PACKAGE__->meta->make_immutable;
52  
53 1 1;
54  
55 __END__
« lib/HTML/FormFu/Role/Constraint/Others.pm ↑ Summary lib/HTML/FormFu/Role/Element/Group.pm »