lib/Web/ComposableRequest/Constants.pm

filter: Statementstmt 100% 20 / 20 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 2 / 2 totaltotal 100% 32 / 32 CC 3 SCAR 5.6
CC
3
Cov
100%
Exception_Class
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« blib/lib/Web/ComposableRequest/Role/Headers.pm ↑ Summary lib/Web/ComposableRequest/Config.pm »
1 package Web::ComposableRequest::Constants;
2  
3 1 ▶use strictures;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use parent 'Exporter::Tiny';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Web::ComposableRequest::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Role::Tiny ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 our @EXPORT = qw( COMMA EXCEPTION_CLASS FALSE LANG NUL SPC TRUE );
10  
11 1 my $Exception_Class = 'Web::ComposableRequest::Exception';
12  
13 sub COMMA () { q(,) }
14 sub FALSE () { 0 }
15 sub LANG () { 'en' }
16 sub NUL () { q() }
17 sub SPC () { q( ) }
18 sub TRUE () { 1 }
19  
20 2 ▶sub EXCEPTION_CLASS () { __PACKAGE__->Exception_Class }
Subroutine EXCEPTION_CLASS: called CC=1 SCAR=0.0
Pod documented
21  
22 6 ▶sub Exception_Class {
Subroutine Exception_Class: called CC=3 SCAR=11.0
Pod documented
23 6 ▶ my ($self, $class) = @_; defined $class or return $Exception_Class;
Branch: 1 branch
BranchTrueFalseTotal
defined $class or return $Exception_Class 2 4 6
24  
25 2 ▶ $class->can( 'throw' ) or $Exception_Class->throw
Branch: 1 branch
BranchTrueFalseTotal
$class->can("throw") or $Exception_Class->throw("Exception class $class is not loaded or has no throw method") 1 1 2
26 ( "Exception class ${class} is not loaded or has no throw method" );
27  
28 1 return $Exception_Class = $class;
29 }
30  
31 1 1;
32  
33 __END__
« blib/lib/Web/ComposableRequest/Role/Headers.pm ↑ Summary lib/Web/ComposableRequest/Config.pm »