Request/Types.pm

filter: Statementstmt 100% 27 / 27 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 97.3% 36 / 37 CC 2 SCAR 2.1
CC
2
Cov
97%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Request.pm ↑ Summary Request/Upload.pm »
1 package Web::Request::Types;
2 26 our $AUTHORITY = 'cpan:PTC';
3 26 $Web::Request::Types::VERSION = '0.12';
4 26 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 26 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 # ABSTRACT: package defining subtypes for this distribution
7  
8 26 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 26 class_type('HTTP::Headers');
11  
12 subtype 'Web::Request::Types::StringLike',
13 as 'Object',
14 2 ▶ where {
Subroutine __ANON__: called CC=2 SCAR=7.1
15 2 ▶ return unless overload::Method($_, '""');
Branch: 1 branch
BranchTrueFalseTotal
unless overload::Method($_, "\"\"") 0 2 2
16 2 my $tc = find_type_constraint('Web::Request::Types::PSGIBodyObject');
17 2 return !$tc->check($_);
18 26 };
19  
20 26 duck_type 'Web::Request::Types::PSGIBodyObject' => ['getline', 'close'];
21  
22 26 subtype 'Web::Request::Types::PSGIBody',
23 as 'ArrayRef[Str|Web::Request::Types::StringLike]|FileHandle|Web::Request::Types::PSGIBodyObject';
24  
25 subtype 'Web::Request::Types::HTTPStatus',
26 as 'Int',
27 44 ▶ where { /^[1-5][0-9][0-9]$/ };
Subroutine __ANON__: called CC=1 SCAR=0.0
28  
29 26 subtype 'Web::Request::Types::HTTP::Headers',
30 as 'HTTP::Headers';
31 coerce 'Web::Request::Types::HTTP::Headers',
32 from 'ArrayRef',
33 2 ▶ via { HTTP::Headers->new(@$_) },
Subroutine __ANON__: called CC=1 SCAR=0.0
34 from 'HashRef',
35 13 ▶ via { HTTP::Headers->new(%$_) };
Subroutine __ANON__: called CC=1 SCAR=0.0
36  
37 coerce 'Web::Request::Types::PSGIBody',
38 from 'Str|Web::Request::Types::StringLike',
39 18 ▶ via { [ $_ ] };
Subroutine __ANON__: called CC=1 SCAR=0.0
40  
41 26 1;
42  
43 __END__
« Request.pm ↑ Summary Request/Upload.pm »